aboutsummaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAge
* Add missing format attributesPeter Eisentraut2011-09-10
| | | | | | | | | | | Add __attribute__ decorations for printf format checking to the places that were missing them. Fix the resulting warnings. Add -Wmissing-format-attribute to the standard set of warnings for GCC, so these don't happen again. The warning fixes here are relatively harmless. The one serious problem discovered by this was already committed earlier in cf15fb5cabfbc71e07be23cfbc813daee6c5014f.
* Move Timestamp/Interval typedefs and basic macros into datatype/timestamp.h.Tom Lane2011-09-09
| | | | | | | | | | | As per my recent proposal, this refactors things so that these typedefs and macros are available in a header that can be included in frontend-ish code. I also changed various headers that were undesirably including utils/timestamp.h to include datatype/timestamp.h instead. Unsurprisingly, this showed that half the system was getting utils/timestamp.h by way of xlog.h. No actual code changes here, just header refactoring.
* In pg_upgrade, disallow migration of 8.3 clusters using contrib/ltreeBruce Momjian2011-09-07
| | | | | | | | because its internal format was changed in 8.4. Backpatch to 9.0 and 9.1. Report by depesz, diagnosis by Tom.
* Clean up the #include mess a little.Tom Lane2011-09-04
| | | | | | | | | | | | | | | | | walsender.h should depend on xlog.h, not vice versa. (Actually, the inclusion was circular until a couple hours ago, which was even sillier; but Bruce broke it in the expedient rather than logically correct direction.) Because of that poor decision, plus blind application of pgrminclude, we had a situation where half the system was depending on xlog.h to include such unrelated stuff as array.h and guc.h. Clean up the header inclusion, and manually revert a lot of what pgrminclude had done so things build again. This episode reinforces my feeling that pgrminclude should not be run without adult supervision. Inclusion changes in header files in particular need to be reviewed with great care. More generally, it'd be good if we had a clearer notion of module layering to dictate which headers can sanely include which others ... but that's a big task for another day.
* Remove unnecessary #include references, per pgrminclude script.Bruce Momjian2011-09-01
|
* Userspace access vector cache for contrib/sepgsql.Robert Haas2011-09-01
| | | | KaiGai Kohei
* Fix "is db labeled test?" in chkselinuxenv script.Robert Haas2011-09-01
| | | | | | Don't test whether the number of labels is numerically equal to zero; count(*) isn't going return zero anyway, and the current coding blows up if it returns an empty string or an error.
* Remove "fmgr.h" include in cube contrib --- caused crash on a GentooBruce Momjian2011-09-01
| | | | builfarm member.
* Fix not-backwards-compatible pg_upgrade test for prepared transactions.Tom Lane2011-08-30
| | | | | | There's no reason for this test to use the undocumented pg_prepared_xact() function, when it can use the stable API pg_prepared_xacts instead. Fixes breakage against 8.3, as reported by Justin Arnold.
* Allow more include files to be compiled in their own by adding missingBruce Momjian2011-08-27
| | | | | | include dependencies. Modify pgcompinclude to skip a common fcinfo error.
* Add postgres.h to *.c files for pg_upgrade, ltree, and btree_gist, andBruce Momjian2011-08-26
| | | | | | remove from local *.h files. Per suggestion from Alvaro.
* In pg_upgrade, limit schema name filter to include toast tables. BugBruce Momjian2011-08-26
| | | | | | introduced recently when trying to filter out temp tables. Backpatch to 9.0 and 9.1.
* Add "%option warn" to all flex input files that lacked it.Tom Lane2011-08-25
| | | | | This is recommended in the flex manual, and there seems no good reason not to use it everywhere.
* Add a regression test for pgstattuple.Tom Lane2011-08-25
| | | | This is mainly to prove that the NaN fix actually works cross-platform.
* Fix pgstatindex() to give consistent results for empty indexes.Tom Lane2011-08-24
| | | | | | | | | | | | | | | | For an empty index, the pgstatindex() function would compute 0.0/0.0 for its avg_leaf_density and leaf_fragmentation outputs. On machines that follow the IEEE float arithmetic standard with any care, that results in a NaN. However, per report from Rushabh Lathia, Microsoft couldn't manage to get this right, so you'd get a bizarre error on Windows. Fix by forcing the results to be NaN explicitly, rather than relying on the division operator to give that or the snprintf function to print it correctly. I have some doubts that this is really the most useful definition, but it seems better to remain backward-compatible with those platforms for which the behavior wasn't completely broken. Back-patch to 8.2, since the code is like that in all current releases.
* Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.Tom Lane2011-08-24
| | | | | | | | | | | | | | The previous coding resulted in contrib modules unintentionally overriding the use of CONTRIB_TESTDB. There seems no particularly good reason to allow that (after all, the makefile can set CONTRIB_TESTDB if that's really what it intends). In passing, document REGRESS_OPTS where the other pgxs.mk options are documented. Back-patch to 9.1 --- in prior versions, there were no cases of contrib modules setting REGRESS_OPTS without including the --dbname switch, so while the coding was fragile there was no actual bug.
* Avoid locale dependency in expected output.Tom Lane2011-08-24
| | | | | | We'll have to settle for just listing the extensions' data types, since function arguments seem to sort differently in different locales. Per buildfarm results.
* Fix multiple bugs in extension dropping.Tom Lane2011-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | When we implemented extensions, we made findDependentObjects() treat EXTENSION dependency links similarly to INTERNAL links. However, that logic contained an implicit assumption that an object could have at most one INTERNAL dependency, so it did not work correctly for objects having both INTERNAL and DEPENDENCY links. This led to failure to drop some extension member objects when dropping the extension. Furthermore, we'd never actually exercised the case of recursing to an internally-referenced (owning) object from anything other than a NORMAL dependency, and it turns out that passing the incoming dependency's flags to the owning object is the Wrong Thing. This led to sometimes dropping a whole extension silently when we should have rejected the drop command for lack of CASCADE. Since we obviously were under-testing extension drop scenarios, add some regression test cases. Unfortunately, such test cases require some extensions (duh), so we can't test for problems in the core regression tests. I chose to add them to the earthdistance contrib module, which is a good test case because it has a dependency on the cube contrib module. Back-patch to 9.1. Arguably these are pre-existing bugs in INTERNAL dependency handling, but since it appears that the cases can never arise pre-9.1, I'll refrain from back-patching the logic changes further than that.
* Clean up 'chkselinuxenv' script.Robert Haas2011-08-19
| | | | | | | | Eliminate dependencies on "which", as we don't really need that to be installed for proper testing. Don't number the tests, as that increases the footprint of every patch that wants to add or remove tests. Make the test output more informative, so that it's a bit easier to see what went right (or wrong). Spelling and grammar improvements.
* Fix contrib/sepgsql and contrib/xml2 to always link required libraries.Robert Haas2011-08-19
| | | | | | | | | | contrib/xml2 can get by without libxslt; the relevant features just won't work. But if doesn't have libxml2, or if sepgsql doesn't have libselinux, the link succeeds but the module then fails to work at load time. To avoid that, link the require libraries unconditionally, so that it will be clear at link-time that there is a problem. Per discussion with Tom Lane and KaiGai Kohei.
* Allow sepgsql regression tests to be run from a user homedir.Robert Haas2011-08-19
| | | | KaiGai Kohei, with some changes by me.
* In pg_upgrade, don't copy visibility map files from clusters that did notBruce Momjian2011-08-19
| | | | | | have crash-safe visibility maps to clusters that expect crash-safety. Request from Robert Haas.
* Typo fix.Robert Haas2011-08-18
|
* In pg_upgrade, avoid dumping orphaned temporary tables. This makes theBruce Momjian2011-08-15
| | | | | | pg_upgrade schema matching pattern match pg_dump/pg_dumpall. Fix for 9.0, 9.1, and 9.2.
* Message style improvementsPeter Eisentraut2011-08-14
|
* Teach vacuumlo to limit number of removals, via new -l option.Robert Haas2011-08-08
| | | | | | | Also, handle failure better: don't just blindly keep trying to delete stuff after the transaction has already failed. Tim Lewis, reviewed by Josh Kupershmidt, with further hacking by me.
* Modestly improve pgbench's checking for invalid ranges.Robert Haas2011-08-05
| | | | | | | | | | The old check against MAX_RANDOM_VALUE is clearly irrelevant since getrand() no longer calls random(). Instead, check whether min and max are close enough together to avoid an overflow inside getrand(), as suggested by Tom Lane. This is still somewhat silly, because we're using atoi(), which doesn't check for overflow anyway and (at least on my system) will cheerfully return 0 when given "4294967296". But that's a problem for another commit.
* Make pgbench use erand48() rather than random().Robert Haas2011-08-03
| | | | | | | | | | | | | | | | | | glibc renders random() thread-safe by wrapping a futex lock around it; testing reveals that this limits the performance of pgbench on machines with many CPU cores. Rather than switching to random_r(), which is only available on GNU systems and crashes unless you use undocumented alchemy to initialize the random state properly, switch to our built-in implementation of erand48(), which is both thread-safe and concurrent. Since the list of reasons not to use the operating system's erand48() is getting rather long, rename ours to pg_erand48() (and similarly for our implementations of lrand48() and srand48()) and just always use those. We were already doing this on Cygwin anyway, and the glibc implementation is not quite thread-safe, so pgbench wouldn't be able to use that either. Per discussion with Tom Lane.
* Fix pg_update to properly test for the data directory's existence onBruce Momjian2011-07-30
| | | | | | Win32. Backpatch to 9.1.
* Move new pgbench options to correct section of --help output.Robert Haas2011-07-29
|
* Add some environment checks prior to sepgsql regression testing.Robert Haas2011-07-25
| | | | | | This probably needs more work, but it's a start. KaiGai Kohei
* Add new pgbench options, --tablespace and --index-tablespace.Robert Haas2011-07-25
| | | | Per a request from Greg Smith.
* Add new pgbench switch, --unlogged-tables.Robert Haas2011-07-25
| | | | | This entails adjusting pgbench to use getopt_long() rather than getopt().
* In pg_upgrade on Windows, check if the directory is writable by actuallyBruce Momjian2011-07-24
| | | | | | | creating and removing a file because access() doesn't work on that platform. Backpatch to 9.1 where this check was added.
* In pg_upgrade, add C comment about why we don't try to do shared fileBruce Momjian2011-07-21
| | | | writes for logging.
* In pg_upgrade, fix the -l/log option to work on Windows.Bruce Momjian2011-07-20
| | | | | | | Also, double-quote the log file name in all places, to allow (on all platforms) log file names with spaces. Back patch to 9.0 and 9.1.
* In pg_upgrade, use pg_strudup(), for consistency.Bruce Momjian2011-07-20
|
* Rewrite libxml error handling to be more robust.Tom Lane2011-07-20
| | | | | | | | | | | | | | | | | | | | | libxml reports some errors (like invalid xmlns attributes) via the error handler hook, but still returns a success indicator to the library caller. This causes us to miss some errors that are important to report. Since the "generic" error handler hook doesn't know whether the message it's getting is for an error, warning, or notice, stop using that and instead start using the "structured" error handler hook, which gets enough information to be useful. While at it, arrange to save and restore the error handler hook setting in each libxml-using function, rather than assuming we can set and forget the hook. This should improve the odds of working nicely with third-party libraries that also use libxml. In passing, volatile-ize some local variables that get modified within PG_TRY blocks. I noticed this while testing with an older gcc version than I'd previously tried to compile xml.c with. Florian Pflug and Tom Lane, with extensive review/testing by Noah Misch
* Put inline declaration before return typePeter Eisentraut2011-07-19
| | | | | gcc -Wextra complains that the other way around is obsolescent, and this was the only place where it was written in this order.
* Replace errdetail("%s", ...) with errdetail_internal("%s", ...).Tom Lane2011-07-16
| | | | | | There may be some other places where we should use errdetail_internal, but they'll have to be evaluated case-by-case. This commit just hits a bunch of places where invoking gettext is obviously a waste of cycles.
* Make pg_upgrade output more consistent with project stylePeter Eisentraut2011-07-12
| | | | | | Add errno-based output to error messages where appropriate, reformat blocks to about 72 characters per line, use spaces instead of tabs for indentation, and other style adjustments.
* Fix use of unportable %m formatPeter Eisentraut2011-07-07
|
* Make the file_fdw validator check that a filename option has been provided.Tom Lane2011-07-05
| | | | | | This was already a runtime failure condition, but it's better to check at validation time if possible. Lightly modified version of a patch by Shigeru Hanada.
* Postgres -> PostgreSQL in error messagePeter Eisentraut2011-07-05
|
* Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.hAlvaro Herrera2011-07-04
| | | | | This lets us stop including rel.h into execnodes.h, which is a widely used header.
* Make distprep and *clean build targets recurse into all subdirectories.Tom Lane2011-07-03
| | | | | | | | | | | | | | | | | | | Certain subdirectories do not get built if corresponding options are not selected at configure time. However, "make distprep" should visit such directories anyway, so that constructing derived files to be included in the tarball happens without requiring all configure options to be given in the tarball build script. Likewise, it's better if cleanup actions unconditionally visit all directories (for example, this ensures proper cleanup if someone has done a manual make in such a subdirectory). To handle this, set up a convention that subdirectories that are conditionally included in SUBDIRS should be added to ALWAYS_SUBDIRS instead when they are excluded. Back-patch to 9.1, so that plpython's spiexceptions.h will get provided in 9.1 tarballs. There don't appear to be any instances where distprep actions got missed in previous releases, and anyway this fix requires gmake 3.80 so we don't want to apply it before 9.1.
* Change pg_upgrade to use port 50432 by default to avoid unintendedBruce Momjian2011-07-01
| | | | | client connections during the upgrade. Also rename data/bin/port environment variables to being with 'PG'. Also no longer honor PGPORT.
* Remove rel.h from objectaddress.h; only relcache.h is necessary.Alvaro Herrera2011-06-28
| | | | Add rel.h to some files that now need it.
* Async dblink functions require a named connection, and therefore shouldJoe Conway2011-06-25
| | | | | use DBLINK_GET_NAMED_CONN rather than DBLINK_GET_CONN. Problem found by Peter Eisentraut and patch by Fujii Masao.
* In pg_upgrade, check that the binary and data directories are the sameBruce Momjian2011-06-22
| | | | | | | | major version. Backpatch to 9.1. Dan McGee