aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* timeline is not needed in BaseBackup()Magnus Hagander2011-04-27
| | | | | | | | This code was accidentally part of the patch, it's only needed for the code that's for 9.2. Not needing the timeline also removes the need to call IDENTIFY_SYSTEM. Noted by Peter E.
* Fix array- and path-creating functions to ensure padding bytes are zeroes.Tom Lane2011-04-27
| | | | | | | | | | | | | | | | | | | | | | | | Per recent discussion, it's important for all computed datums (not only the results of input functions) to not contain any ill-defined (uninitialized) bits. Failing to ensure that can result in equal() reporting that semantically indistinguishable Consts are not equal, which in turn leads to bizarre and undesirable planner behavior, such as in a recent example from David Johnston. We might eventually try to fix this in a general manner by allowing datatypes to define identity-testing functions, but for now the path of least resistance is to expect datatypes to force all unused bits into consistent states. Per some testing by Noah Misch, array and path functions seem to be the only ones presenting risks at the moment, so I looked through all the functions in adt/array*.c and geo_ops.c and fixed them as necessary. In the array functions, the easiest/safest fix is to allocate result arrays with palloc0 instead of palloc. Possibly in future someone will want to look into whether we can just zero the padding bytes, but that looks too complex for a back-patchable fix. In the path functions, we already had a precedent in path_in for just zeroing the one known pad field, so duplicate that code as needed. Back-patch to all supported branches.
* Revert "Remove hard coded formats for INT64 and use configured settings ↵Andrew Dunstan2011-04-27
| | | | | | | | instead." This reverts commit 9b1508af8971c1627cda5bb65f5e9eddb9a1a55e. As requested by Tom.
* Remove hard coded formats for INT64 and use configured settings instead.Andrew Dunstan2011-04-27
|
* Force use of "%I64d" format for 64 bit ints on MinGW.Andrew Dunstan2011-04-27
| | | | | Both this and "%lld" work, but the compiler's format checking doesn't like "%lld", so we get all sorts of spurious warnings.
* Use an explicit format string to keep the compiler happy.Andrew Dunstan2011-04-27
|
* Rephrase some not-supported error messages in pg_hba.conf processing.Tom Lane2011-04-26
| | | | | | | | | | | | In a couple of places we said "not supported on this platform" for cases that aren't really platform-specific, but could depend on configuration options such as --with-openssl. Use "not supported by this build" instead, as that doesn't convey the impression that you can't fix it without moving to another OS; that's also more consistent with the wording used for an identical error case in guc.c. No back-patch, as the clarity gain is small enough to not be worth burdening translators with back-branch changes.
* Complain if pg_hba.conf contains "hostssl" but SSL is disabled.Tom Lane2011-04-26
| | | | | | | | | | | | | | | | | Most commenters agreed that this is more friendly than silently failing to match the line during actual connection attempts. Also, this will prevent corner cases that might arise when trying to handle such a line when the SSL code isn't turned on. An example is that specifying clientcert=1 in such a line would formerly result in a completely misleading complaint that root.crt wasn't present, as seen in a recent report from Marc-Andre Laverdiere. While we could have instead fixed that specific behavior, it seems likely that we'd have a continuing stream of such bizarre behaviors if we keep on allowing hostssl lines when SSL is disabled. Back-patch to 8.4, where clientcert was introduced. Earlier versions don't have this specific issue, and the code is enough different to make this patch not applicable without more work than it seems worth.
* Remove incorrect HINT for use of ALTER FOREIGN TABLE on the wrong relkind.Tom Lane2011-04-25
| | | | | | | | Per discussion, removing the hint seems better than correcting it because the adjacent analogous cases in RenameRelation don't have any hints, and nobody seems to have missed 'em. Shigeru Hanada
* Refactor broken CREATE TABLE IF NOT EXISTS support.Robert Haas2011-04-25
| | | | | | | | | | | | | | | | Per bug #5988, reported by Marko Tiikkaja, and further analyzed by Tom Lane, the previous coding was broken in several respects: even if the target table already existed, a subsequent CREATE TABLE IF NOT EXISTS might try to add additional constraints or sequences-for-serial specified in the new CREATE TABLE statement. In passing, this also fixes a minor information leak: it's no longer possible to figure out whether a schema to which you don't have CREATE access contains a sequence named like "x_y_seq" by attempting to create a table in that schema called "x" with a serial column called "y". Some more refactoring of this code in the future might be warranted, but that will need to wait for a later major release.
* Remove partial and undocumented GRANT .. FOREIGN TABLE support.Robert Haas2011-04-25
| | | | | | | | | | | Instead, foreign tables are treated just like views: permissions can be granted using GRANT privilege ON [TABLE] foreign_table_name TO role, and revoked similarly. GRANT/REVOKE .. FOREIGN TABLE is no longer supported, just as we don't support GRANT/REVOKE .. VIEW. The set of accepted permissions for foreign tables is now identical to the set for regular tables, and views. Per report from Thom Brown, and subsequent discussion.
* Fix pg_size_pretty() to avoid overflow for inputs close to INT64_MAX.Tom Lane2011-04-25
| | | | | | | | The expression that tried to round the value to the nearest TB could overflow, leading to bogus output as reported in bug #5993 from Nicola Cossu. This isn't likely to ever happen in the intended usage of the function (if it could, we'd be needing to use a wider datatype instead); but it's not hard to give the expected output, so let's do so.
* Support "make check" in contribPeter Eisentraut2011-04-25
| | | | | | | | | | | | | | Added a new option --extra-install to pg_regress to arrange installing the respective contrib directory into the temporary installation. This is currently not yet supported for Windows MSVC builds. Updated the .gitignore files for contrib modules to ignore the leftovers of a temp-install check run. Changed the exit status of "make check" in a pgxs build (which still does nothing) to 0 from 1. Added "make check" in contrib to top-level "make check-world".
* Use terse mode to avoid variable order dependency output in foreign data ↵Andrew Dunstan2011-04-25
| | | | | | regression check. Per Tom Lane's suggestion about my gripe about occasional errors noticed on the buildfarm.
* Assorted minor changes to silence Windows compiler warnings.Andrew Dunstan2011-04-25
| | | | Mostly to do with macro redefinitions or object signedness.
* Prevent perl header overriding our *snprintf macros, and give it a usable ↵Andrew Dunstan2011-04-25
| | | | | | | | PERL_UNUSED_DECL value. This quiets compiler warnings about redefined macros and unused Perl__unused variables. The redefinition of snprintf and vsnprintf is something we want to avoid anyway, if we've gone to the bother of setting up the macros to point to our implementation.
* Give getopt() a prototype and modern style arg specs.Andrew Dunstan2011-04-25
| | | | Welcome to the 1990s.
* Add postmaster/postgres undocumented -b option for binary upgrades.Bruce Momjian2011-04-25
| | | | | | | | | | This option turns off autovacuum, prevents non-super-user connections, and enables oid setting hooks in the backend. The code continues to use the old autoavacuum disable settings for servers with earlier catalog versions. This includes a catalog version bump to identify servers that support the -b option.
* Add fast paths for cases when no serializable transactions are running.Robert Haas2011-04-25
| | | | Dan Ports
* Regression tests for TOAST.Robert Haas2011-04-25
| | | | Kevin Grittner, per discussion of bug #5989
* Fix SSI-related assertion failure.Robert Haas2011-04-25
| | | | | | Bug #5899, reported by Marko Tiikkaja. Heikki Linnakangas, reviewed by Kevin Grittner and Dan Ports.
* Adjust yywrap macro for non-reentrant scanners for MSVC.Andrew Dunstan2011-04-25
| | | | | | | | The MSVC compiler complains if a macro is called with less arguments than its definition provides for. flex generates a macro with one argument for yywrap, but only supplies the argument for reentrant scanners, so we remove the useless argument in the non-reentrant case to silence the warning.
* In libecpg do not set an sqlda field that is 'reserved for future use' unlessMichael Meskes2011-04-25
| | | | we know what should be stored in there.
* Improve cost estimation for aggregates and window functions.Tom Lane2011-04-24
| | | | | | | | | | | | | | | | The previous coding failed to account properly for the costs of evaluating the input expressions of aggregates and window functions, as seen in a recent gripe from Claudio Freire. (I said at the time that it wasn't counting these costs at all; but on closer inspection, it was effectively charging these costs once per output tuple. That is completely wrong for aggregates, and not exactly right for window functions either.) There was also a hard-wired assumption that aggregates and window functions had procost 1.0, which is now fixed to respect the actual cataloged costs. The costing of WindowAgg is still pretty bogus, since it doesn't try to estimate the effects of spilling data to disk, but that seems like a separate issue.
* Improve findoidjoins to cover more cases.Tom Lane2011-04-23
| | | | | | | | | | | Teach the program and script to deal with OID-array referencing columns, which we now have several of. Also, modify the recommended usage process to specify that the program should be run against the regression database rather than template1. This lets it find numerous joins that cannot be found in template1 because the relevant catalogs are entirely empty. Together these changes add seventeen formerly-missed cases to the oidjoins regression test.
* Silence a few compiler warnings from gcc on MinGW.Andrew Dunstan2011-04-23
| | | | | | | Most of these cast DWORD to int or unsigned int for printf type handling. This is safe even on 64 bit architectures because a DWORD is always 32 bits. In one case a variable is initialised to keep the compiler happy.
* Update oidjoins regression test for 9.1 catalog schema additions.Tom Lane2011-04-23
|
* Hash indexes had better pass the index collation to support functions, too.Tom Lane2011-04-23
| | | | | Per experimentation with contrib/citext, whose hash function assumes that it'll be passed a collation.
* Adjust comments about collate.linux.utf8 regression test.Tom Lane2011-04-23
| | | | | | | This test should now work in any database with UTF8 encoding, regardless of the database's default locale. The former restriction was really "doesn't work if default locale is C", and that was because of not handling mbstowcs/wcstombs correctly.
* Fix char2wchar/wchar2char to support collations properly.Tom Lane2011-04-23
| | | | | | | | | | | | | | | | | These functions should take a pg_locale_t, not a collation OID, and should call mbstowcs_l/wcstombs_l where available. Where those functions are not available, temporarily select the correct locale with uselocale(). This change removes the bogus assumption that all locales selectable in a given database have the same wide-character conversion method; in particular, the collate.linux.utf8 regression test now passes with LC_CTYPE=C, so long as the database encoding is UTF8. I decided to move the char2wchar/wchar2char functions out of mbutils.c and into pg_locale.c, because they work on wchar_t not pg_wchar_t and thus don't really belong with the mbutils.c functions. Keeping them where they were would have required importing pg_locale_t into pg_wchar.h somehow, which did not seem like a good plan.
* Make GIN and GIST pass the index collation to all their support functions.Tom Lane2011-04-22
| | | | | | | Experimentation with contrib/btree_gist shows that the majority of the GIST support functions potentially need collation information. Safest policy seems to be to pass it to all of them, instead of making assumptions about which ones could possibly need it.
* Small update to emacs example configurationPeter Eisentraut2011-04-23
| | | | | | Since both tarballs and git now result in a "postgresql" directory rather than a "pgsql" directory, adjust the example configuration to look for the former.
* Add fill-column setting to emacs example configurationsPeter Eisentraut2011-04-23
| | | | This matches the maximum line length that pgindent uses.
* Make a code-cleanup pass over the collations patch.Tom Lane2011-04-22
| | | | | | | This patch is almost entirely cosmetic --- mostly cleaning up a lot of neglected comments, and fixing code layout problems in places where the patch made lines too long and then pgindent did weird things with that. I did find a bug-of-omission in equalTupleDescs().
* Avoid possible divide-by-zero in gincostestimate.Tom Lane2011-04-21
| | | | Per report from Jeff Janes.
* Allow ALTER TYPE .. ADD ATTRIBUTE .. CASCADE to recurse to descendants.Robert Haas2011-04-20
| | | | | | | Without this, adding an attribute to a typed table with an inheritance child fails, which is surprising. Noah Misch, with minor changes by me.
* Fix use of incorrect constant RemoveRoleFromObjectACL.Robert Haas2011-04-20
| | | | | | | This could cause failures when DROP OWNED BY attempt to remove default privileges on sequences. Back-patching to 9.0. Shigeru Hanada
* Typo fix.Robert Haas2011-04-20
|
* Allow ALTER TABLE name {OF type | NOT OF}.Robert Haas2011-04-20
| | | | | | | | | | | This syntax allows a standalone table to be made into a typed table, or a typed table to be made standalone. This is possibly a mildly useful feature in its own right, but the real motivation for this change is that we need it to make pg_upgrade work with typed tables. This doesn't actually fix that problem, but it's necessary infrastructure. Noah Misch
* Fix bugs in indexing of in-doubt HOT-updated tuples.Tom Lane2011-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | If we find a DELETE_IN_PROGRESS HOT-updated tuple, it is impossible to know whether to index it or not except by waiting to see if the deleting transaction commits. If it doesn't, the tuple might again be LIVE, meaning we have to index it. So wait and recheck in that case. Also, we must not rely on ii_BrokenHotChain to decide that it's possible to omit tuples from the index. That could result in omitting tuples that we need, particularly in view of yesterday's fixes to not necessarily set indcheckxmin (but it's broken even without that, as per my analysis today). Since this is just an extremely marginal performance optimization, dropping the test shouldn't hurt. These cases are only expected to happen in system catalogs (they're possible there due to early release of RowExclusiveLock in most catalog-update code paths). Since reindexing of a system catalog isn't a particularly performance-critical operation anyway, there's no real need to be concerned about possible performance degradation from these changes. The worst aspects of this bug were introduced in 9.0 --- 8.x will always wait out a DELETE_IN_PROGRESS tuple. But I think dropping index entries on the strength of ii_BrokenHotChain is dangerous even without that, so back-patch removal of that optimization to 8.3 and 8.4.
* Set indcheckxmin true when REINDEX fixes an invalid or not-ready index.Tom Lane2011-04-20
| | | | | | | | | | | Per comment from Greg Stark, it's less clear that HOT chains don't conflict with the index than it would be for a valid index. So, let's preserve the former behavior that indcheckxmin does get set when there are potentially-broken HOT chains in this case. This change does not cause any pg_index update that wouldn't have happened anyway, so we're not re-introducing the previous bug with pg_index updates, and surely the case is not significant from a performance standpoint; so let's be as conservative as possible.
* Make plan_cluster_use_sort cope with no IndexOptInfo for the target index.Tom Lane2011-04-20
| | | | | | | | | The original coding assumed that such a case represents caller error, but actually get_relation_info will omit generating an IndexOptInfo for any index it thinks is unsafe to use. Therefore, handle this case by returning "true" to indicate that a seqscan-and-sort is the preferred way to implement the CLUSTER operation. New bug in 9.1, no backpatch needed. Per bug #5985 from Daniel Grace.
* Fix PL/Python traceback for error in separate filePeter Eisentraut2011-04-20
| | | | | | | | | | | | It assumed that the lineno from the traceback always refers to the PL/Python function. If you created a PL/Python function that imports some code, runs it, and that code raises an exception, PLy_traceback would get utterly confused. Now we look at the file name reported with the traceback and only print the source line if it came from the PL/Python function. Jan Urbański
* Quotes in strings injected into bki file need to escaped. In particular,Heikki Linnakangas2011-04-20
| | | | | | | | | "People's Republic of China" locale on Windows was causing initdb to fail. This fixes bug #5818 reported by yulei. On master, this makes the mapping of "People's Republic of China" to just "China" obsolete. In 9.0 and 8.4, just fix the escaping. Earlier versions didn't have locale names in bki file.
* Avoid changing an index's indcheckxmin horizon during REINDEX.Tom Lane2011-04-19
| | | | | | | | | | | | | | | | | | | | There can never be a need to push the indcheckxmin horizon forward, since any HOT chains that are actually broken with respect to the index must pre-date its original creation. So we can just avoid changing pg_index altogether during a REINDEX operation. This offers a cleaner solution than my previous patch for the problem found a few days ago that we mustn't try to update pg_index while we are reindexing it. System catalog indexes will always be created with indcheckxmin = false during initdb, and with this modified code we should never try to change their pg_index entries. This avoids special-casing system catalogs as the former patch did, and should provide a performance benefit for many cases where REINDEX formerly caused an index to be considered unusable for a short time. Back-patch to 8.3 to cover all versions containing HOT. Note that this patch changes the API for index_build(), but I believe it is unlikely that any add-on code is calling that directly.
* Revert "Prevent incorrect updates of pg_index while reindexing pg_index itself."Tom Lane2011-04-19
| | | | | This reverts commit 4b6106ccfea21e86943f881edcf3cfc03661a415 of 2011-04-15. There's a better way to do it, which will follow shortly.
* Refix the unaccent regression test on MSVC properlyPeter Eisentraut2011-04-19
| | | | | | ... for some value of "properly". Instead of overriding REGRESS_OPTS, set the variables ENCODING and NO_LOCALE, which is more expressive and allows overriding by the user. Fix vcregress.pl to handle that.
* Treat config.pl as optional in vcregress.plPeter Eisentraut2011-04-19
| | | | This is how build.pl treats it and how it's documented.
* Fix typoPeter Eisentraut2011-04-19
|
* Add gitignore entries for Windows MSVC buildsPeter Eisentraut2011-04-19
|