summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2012-01-25Now that the shared library name can be adjusted in the library test,Bruce Momjian
have pg_upgrade allocate a maximum fixed size buffer for testing the library file name, rather than base the allocation on the library name. Backpatch to 9.1.
2012-01-24In pg_upgrade, when checking for the plpython library, we must check forBruce Momjian
"plpython2" when upgrading from pre-PG 9.1. Patch to head and 9.1. Per report from Peter.
2012-01-09Fix one-byte buffer overrun in contrib/test_parser.Tom Lane
The original coding examined the next character before verifying that there *is* a next character. In the worst case with the input buffer right up against the end of memory, this would result in a segfault. Problem spotted by Paul Guyot; this commit extends his patch to fix an additional case. In addition, make the code a tad more readable by not overloading the usage of *tlen.
2011-12-05In pg_upgrade, allow tables using regclass to be upgraded because weBruce Momjian
preserve pg_class oids since PG 9.0.
2011-11-26Fix overly-aggressive and inconsistent quoting in OS X start script.Tom Lane
Sidar Lopez, per bug #6310, with some additional improvements by me. Back-patch to 9.0, where the issue was introduced.
2011-11-21Fix citext upgrade script to update derived copies of pg_type.typcollation.Tom Lane
If the existing citext type has not merely been created, but used in any tables, then the upgrade script wasn't doing enough. We have to update attcollation for each citext table column, and indcollation for each citext index column, as well. Per report from Rudolf van der Leeden.
2011-11-17Fix pg_upgrade's pg_scandir_internal() the right way. Backpatch to 9.1.Bruce Momjian
2011-11-17Fix pg_upgrade's pg_scandir_internal() to properly handle a NULLBruce Momjian
pattern, which is used on PG 9.1 and HEAD (but not pre-9.1). Fixes crash on Windows. Backpatched to 9.1. Reported by Mark Dilger
2011-11-07Fix assorted bugs in contrib/unaccent's configuration file parsing.Tom Lane
Make it use t_isspace() to identify whitespace, rather than relying on sscanf which is known to get it wrong on some platform/locale combinations. Get rid of fixed-size buffers. Make it actually continue to parse the file after ignoring a line with untranslatable characters, as was obviously intended. The first of these issues is per gripe from J Smith, though not exactly either of his proposed patches.
2011-11-03Fix bogus code in contrib/ tsearch dictionary examples.Tom Lane
Both dict_int and dict_xsyn were blithely assuming that whatever memory palloc gives back will be pre-zeroed. This would typically work for just about long enough to run their regression tests, and no longer :-(. The pre-9.0 code in dict_xsyn was even lamer than that, as it would happily give back a pointer to the result of palloc(0), encouraging its caller to access off the end of memory. Again, this would just barely fail to fail as long as memory contained nothing but zeroes. Per a report from Rodrigo Hjort that code based on these examples didn't work reliably.
2011-10-12Throw a useful error message if an extension script file is fed to psql.Tom Lane
We have seen one too many reports of people trying to use 9.1 extension files in the old-fashioned way of sourcing them in psql. Not only does that usually not work (due to failure to substitute for MODULE_PATHNAME and/or @extschema@), but if it did work they'd get a collection of loose objects not an extension. To prevent this, insert an \echo ... \quit line that prints a suitable error message into each extension script file, and teach commands/extension.c to ignore lines starting with \echo. That should not only prevent any adverse consequences of loading a script file the wrong way, but make it crystal clear to users that they need to do it differently now. Tom Lane, following an idea of Andrew Dunstan's. Back-patch into 9.1 ... there is not going to be much value in this if we wait till 9.2.
2011-10-06Make pgstatindex respond to cancel interrupts.Robert Haas
A similar problem for pgstattuple() was fixed in April of 2010 by commit 33065ef8bc52253ae855bc959576e52d8a28ba06, but pgstatindex() seems to have been overlooked. Back-patch all the way, as with that commit, though not to 7.4 through 8.1, since those are now EOL.
2011-09-28In pg_upgrade, because toast table names can be mismatched with the heapBruce Momjian
oid on 8.4, modify the toast name comparison test to only apply to old 9.0+ servers. (The test was previously 8.4+.)
2011-09-27Take sepgsql regression tests out of the regular regression test mechanism.Tom Lane
Back-port the new "test_sepgsql" script into 9.1 to provide a substitute test mechanism.
2011-09-07In pg_upgrade, disallow migration of 8.3 clusters using contrib/ltreeBruce Momjian
because its internal format was changed in 8.4. Backpatch to 9.0 and 9.1. Report by depesz, diagnosis by Tom.
2011-08-30Fix not-backwards-compatible pg_upgrade test for prepared transactions.Tom Lane
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.
2011-08-26In pg_upgrade, limit schema name filter to include toast tables. BugBruce Momjian
introduced recently when trying to filter out temp tables. Backpatch to 9.0 and 9.1.
2011-08-24Fix pgstatindex() to give consistent results for empty indexes.Tom Lane
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.
2011-08-24Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.Tom Lane
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.
2011-08-24Avoid locale dependency in expected output.Tom Lane
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.
2011-08-24Fix multiple bugs in extension dropping.Tom Lane
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.
2011-08-19Fix contrib/sepgsql and contrib/xml2 to always link required libraries.Robert Haas
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.
2011-08-19Allow sepgsql regression tests to be run from a user homedir.Robert Haas
KaiGai Kohei, with some changes by me.
2011-08-15In pg_upgrade, avoid dumping orphaned temporary tables. This makes theBruce Momjian
pg_upgrade schema matching pattern match pg_dump/pg_dumpall. Fix for 9.0, 9.1, and 9.2.
2011-08-14Message style improvementsPeter Eisentraut
2011-07-30Fix pg_update to properly test for the data directory's existence onBruce Momjian
Win32. Backpatch to 9.1.
2011-07-24In pg_upgrade on Windows, check if the directory is writable by actuallyBruce Momjian
creating and removing a file because access() doesn't work on that platform. Backpatch to 9.1 where this check was added.
2011-07-20In pg_upgrade, fix the -l/log option to work on Windows.Bruce Momjian
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.
2011-07-16Replace errdetail("%s", ...) with errdetail_internal("%s", ...).Tom Lane
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.
2011-07-07Fix use of unportable %m formatPeter Eisentraut
2011-07-05Make the file_fdw validator check that a filename option has been provided.Tom Lane
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.
2011-07-05Postgres -> PostgreSQL in error messagePeter Eisentraut
2011-07-03Make distprep and *clean build targets recurse into all subdirectories.Tom Lane
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.
2011-06-25Async dblink functions require a named connection, and therefore shouldJoe Conway
use DBLINK_GET_NAMED_CONN rather than DBLINK_GET_CONN. Problem found by Peter Eisentraut and patch by Fujii Masao.
2011-06-22In pg_upgrade, check that the binary and data directories are the sameBruce Momjian
major version. Backpatch to 9.1. Dan McGee
2011-06-22Adjust pg_upgrade check for pg_upgrade_support to happen after theBruce Momjian
binary directory has been validated. Backpatch to 9.1. Dan McGee
2011-06-22Fix pg_upgrade status message capitalization mistake.Bruce Momjian
Backpatch to 9.1 and 9.0. Dan McGee
2011-06-21Apply upstream fix for blowfish signed-character bug (CVE-2011-2483).Tom Lane
A password containing a character with the high bit set was misprocessed on machines where char is signed (which is most). This could cause the preceding one to three characters to fail to affect the hashed result, thus weakening the password. The result was also unportable, and failed to match some other blowfish implementations such as OpenBSD's. Since the fix changes the output for such passwords, upstream chose to provide a compatibility hack: password salts beginning with $2x$ (instead of the usual $2a$ for blowfish) are intentionally processed "wrong" to give the same hash as before. Stored password hashes can thus be modified if necessary to still match, though it'd be better to change any affected passwords. In passing, sync a couple other upstream changes that marginally improve performance and/or tighten error checking. Back-patch to all supported branches. Since this issue is already public, no reason not to commit the fix ASAP.
2011-06-14In pg_upgrade, check there are no prepared transactions.Bruce Momjian
Backpatch to 9.1.
2011-06-09Pgindent run before 9.1 beta2.Bruce Momjian
2011-06-08Make citext's equality and hashing functions collation-insensitive.Tom Lane
This is an ugly hack to get around the fact that significant parts of the core backend assume they don't need to worry about passing collation to equality and hashing functions. That's true for the core string datatypes, but citext should ideally have equality behavior that depends on the specified collation's LC_CTYPE. However, there's no chance of fixing the core before 9.2, so we'll have to live with this compromise arrangement for now. Per bug #6053 from Regina Obe. The code changes in this commit should be reverted in full once the core code is up to speed, but be careful about reverting the docs changes: I fixed a number of obsolete statements while at it.
2011-05-31Recode non-ASCII characters in source to UTF-8Peter Eisentraut
For consistency, have all non-ASCII characters from contributors' names in the source be in UTF-8. But remove some other more gratuitous uses of non-ASCII characters.
2011-05-28Remove literal tabs from message stringsPeter Eisentraut
2011-05-24In pg_upgrade, do case-insensitive checks of locale, encoding, and ctypeBruce Momjian
because these are often inconsistently capitalized.
2011-05-18Replace strdup() with pstrdup(), to avoid leaking memory.Heikki Linnakangas
It's been like this since the seg module was introduced, so backpatch to 8.2 which is the oldest supported version.
2011-05-18In pg_upgrade, clean up handling of invalid directory specification byBruce Momjian
checking the stat() errno value more strictly.
2011-05-18Improve pg_upgrade error reporting if the bin or data directories do notBruce Momjian
exist or are not directories.
2011-05-19/contrib/foo -> contrib/fooPeter Eisentraut
Since contrib is a relative directory specification, a leading slash is inappropriate.
2011-05-18Improve pg_upgrade X_OK comment.Bruce Momjian
2011-05-18Fix pg_upgrade build problem on Windows when using X_OK accessBruce Momjian
permission check on the current directory.