summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-06-22pg_rewind: Improve message wordingPeter Eisentraut
2015-06-22pg_basebackup: Remove redundant newline in error messagePeter Eisentraut
2015-06-22Improve inheritance_planner()'s performance for large inheritance sets.Tom Lane
Commit c03ad5602f529787968fa3201b35c119bbc6d782 introduced a planner performance regression for UPDATE/DELETE on large inheritance sets. It required copying the append_rel_list (which is of size proportional to the number of inherited tables) once for each inherited table, thus resulting in O(N^2) time and memory consumption. While it's difficult to avoid that in general, the extra work only has to be done for append_rel_list entries that actually reference subquery RTEs, which inheritance-set entries will not. So we can buy back essentially all of the loss in cases without subqueries in FROM; and even for those, the added work is mainly proportional to the number of UNION ALL subqueries. Back-patch to 9.2, like the previous commit. Tom Lane and Dean Rasheed, per a complaint from Thomas Munro.
2015-06-22psql: Add some tab completion for TABLESAMPLE.Robert Haas
Petr Jelinek, reviewed by Brendan Jurd
2015-06-21Truncate strings in tarCreateHeader() with strlcpy(), not sprintf().Noah Misch
This supplements the GNU libc bug #6530 workarounds introduced in commit 54cd4f04576833abc394e131288bf3dd7dcf4806. On affected systems, a tar-format pg_basebackup failed when some filename beneath the data directory was not valid character data in the postmaster/walsender locale. Back-patch to 9.1, where pg_basebackup was introduced. Extant, bug-prone conversion specifications receive only ASCII bytes or involve low-importance messages.
2015-06-21Add transforms to pg_get_object_address and friendsAlvaro Herrera
This was missed when transforms were added by commit cac76582053ef8e. Extracted from a larger patch Author: Michael Paquier
2015-06-21Improve multixact emergency autovacuum logic.Andres Freund
Previously autovacuum was not necessarily triggered if space in the members slru got tight. The first problem was that the signalling was tied to values in the offsets slru, but members can advance much faster. Thats especially a problem if old sessions had been around that previously prevented the multixact horizon to increase. Secondly the skipping logic doesn't work if the database was restarted after autovacuum was triggered - that knowledge is not preserved across restart. This is especially a problem because it's a common panic-reaction to restart the database if it gets slow to anti-wraparound vacuums. Fix the first problem by separating the logic for members from offsets. Trigger autovacuum whenever a multixact crosses a segment boundary, as the current member offset increases in irregular values, so we can't use a simple modulo logic as for offsets. Add a stopgap for the second problem, by signalling autovacuum whenver ERRORing out because of boundaries. Discussion: 20150608163707.GD20772@alap3.anarazel.de Backpatch into 9.3, where it became more likely that multixacts wrap around.
2015-06-21Add missing check for wal_debug GUC.Andres Freund
9a20a9b2 added a new elog(), enabled when WAL_DEBUG is defined. The other WAL_DEBUG dependant messages check for the wal_debug GUC, but this one did not. While at it replace 'upto' with 'up to'. Discussion: 20150610110253.GF3832@alap3.anarazel.de Backpatch to 9.4, the first release containing 9a20a9b2.
2015-06-21PL/Perl: Add alternative expected file for Perl 5.22Peter Eisentraut
2015-06-20Fix failure to copy setlocale() return value.Noah Misch
POSIX permits setlocale() calls to invalidate any previous setlocale() return values, but commit 5f538ad004aa00cf0881f179f0cde789aad4f47e neglected to account for setlocale(LC_CTYPE, NULL) doing so. The effect was to set the LC_CTYPE environment variable to an unintended value. pg_perm_setlocale() sets this variable to assist PL/Perl; without it, Perl would undo PostgreSQL's locale settings. The known-affected configurations are 32-bit, release builds using Visual Studio 2012 or Visual Studio 2013. Visual Studio 2010 is unaffected, as were all buildfarm-attested configurations. In principle, this bug could leave the wrong LC_CTYPE in effect after PL/Perl use, which could in turn facilitate problems like corrupt tsvector datums. No known platform experiences that consequence, because PL/Perl on Windows does not use this environment variable. The bug has been user-visible, as early postmaster failure, on systems with Windows ANSI code page set to CP936 for "Chinese (Simplified, PRC)" and probably on systems using other multibyte code pages. (SetEnvironmentVariable() rejects values containing character data not valid under the Windows ANSI code page.) Back-patch to 9.4, where the faulty commit first appeared. Reported by Didi Hu and 林鹏程. Reviewed by Tom Lane, though this fix strategy was not his first choice.
2015-06-20Revert "Detect setlocale(LC_CTYPE, NULL) clobbering previous return values."Noah Misch
This reverts commit b76e76be460a240e99c33f6fb470dd1d5fe01a2a. The buildfarm yielded no related failures.
2015-06-20Fix BRIN supported operators tableAlvaro Herrera
Some of the entries in the inclusion opclasses where missing operators, and we had an entry for inet_inclusion_ops instead of network_inclusion_ops. Sort the operators within each opclass by strategy number, just to make it easier to spot mistakes. Also sort the rows by data type name, rather than OID.
2015-06-20Fix thinko in comment (launcher -> worker)Alvaro Herrera
2015-06-19In immediate shutdown, postmaster should not exit till children are gone.Tom Lane
This adjusts commit 82233ce7ea42d6ba519aaec63008aff49da6c7af so that the postmaster does not exit until all its child processes have exited, even if the 5-second timeout elapses and we have to send SIGKILL. There is no great value in having the postmaster process quit sooner, and doing so can mislead onlookers into thinking that the cluster is fully terminated when actually some child processes still survive. This effect might explain recent test failures on buildfarm member hamster, wherein we failed to restart a cluster just after shutting it down with "pg_ctl stop -m immediate". I also did a bit of code review/beautification, including fixing a faulty use of the Max() macro on a volatile expression. Back-patch to 9.4. In older branches, the postmaster never waited for children to exit during immediate shutdowns, and changing that would be too much of a behavioral change.
2015-06-19Clamp autovacuum launcher sleep time to 5 minutesAlvaro Herrera
This avoids the problem that it might go to sleep for an unreasonable amount of time in unusual conditions like the server clock moving backwards an unreasonable amount of time. (Simply moving the server clock forward again doesn't solve the problem unless you wake up the autovacuum launcher manually, say by sending it SIGHUP). Per trouble report from Prakash Itnal in https://www.postgresql.org/message-id/CAHC5u79-UqbapAABH2t4Rh2eYdyge0Zid-X=Xz-ZWZCBK42S0Q@mail.gmail.com Analyzed independently by Haribabu Kommi and Tom Lane.
2015-06-19Fix bogus range_table_mutator() logic for RangeTblEntry.tablesample.Tom Lane
Must make a copy of the TableSampleClause node; the previous coding modified the input data structure in-place. Petr Jelinek
2015-06-19Fix corner case in autovacuum-forcing logic for multixact wraparound.Robert Haas
Since find_multixact_start() relies on SimpleLruDoesPhysicalPageExist(), and that function looks only at the on-disk state, it's possible for it to fail to find a page that exists in the in-memory SLRU that has not been written yet. If that happens, SetOffsetVacuumLimit() will erroneously decide to force emergency autovacuuming immediately. We should probably fix find_multixact_start() to consider the data cached in memory as well as on the on-disk state, but that's no excuse for SetOffsetVacuumLimit() to be stupid about the case where it can no longer read the value after having previously succeeded in doing so. Report by Andres Freund.
2015-06-19Add PASSWORD to tab completions for CREATE/ALTER ROLE/USER/GROUP.Robert Haas
Jeevan Chalke
2015-06-19Change TAP test framework to not rely on having a chmod executable.Robert Haas
This might not work at all on Windows, and is not ever efficient. Michael Paquier
2015-06-17Detect setlocale(LC_CTYPE, NULL) clobbering previous return values.Noah Misch
POSIX permits setlocale() calls to invalidate any previous setlocale() return values. Commit 5f538ad004aa00cf0881f179f0cde789aad4f47e neglected to account for that. In advance of fixing that bug, switch to failing hard on affected configurations. This is a planned temporary commit to assay buildfarm-represented configurations.
2015-06-15Fix comment in fmgr.h to refer to actual function used.Andrew Dunstan
FunctionLookup() is long gone if it ever existed, and fmgr_info() is what's now used, so the comments now reflect that.
2015-06-15Check for out of memory when allocating sqlca.Michael Meskes
Patch by Michael Paquier
2015-06-15Fix memory leak in ecpglib's connect function.Michael Meskes
Patch by Michael Paquier
2015-06-14release notes: fix Petr's name typosBruce Momjian
Report by Alvaro Herrera
2015-06-13doc: Add note to pg_dump man page about pg_dumpallPeter Eisentraut
suggested by Joshua Drake
2015-06-13Remove stray characterPeter Eisentraut
2015-06-13release notes: consistently name "Alexander Shulgin"Bruce Momjian
Report by Alvaro Herrera
2015-06-13release notes: move/remove/adjust itemsBruce Momjian
Report by Alvaro Herrera
2015-06-13release notes: add accent to Petr Jelínek last nameBruce Momjian
Report by Alvaro Herrera
2015-06-13release notes: remove mention of pg_basebackup non-compatBruce Momjian
Report by Amit Kapila
2015-06-12release notes: add Petr Jelinek to JSON function itemBruce Momjian
Report by Petr Jelinek
2015-06-12release notes: fixes from Fujii MasaoBruce Momjian
Report by Fujii Masao
2015-06-12release notes: reorder hash performance authors, againBruce Momjian
Report by Robert Haas
2015-06-12release notes: reorder sort performance authorsBruce Momjian
Report by Peter Geoghegan
2015-06-12release notes: split apart hash itemsBruce Momjian
Report by Tom Lane, Robert Haas
2015-06-12release notes: add two optimizer itemsBruce Momjian
Report by Tom Lane
2015-06-12Fix "path" infrastructure bug affecting jsonb_set()Andrew Dunstan
jsonb_set() and other clients of the setPathArray() utility function could get spurious results when an array integer subscript is provided that is not within the range of int. To fix, ensure that the value returned by strtol() within setPathArray() is within the range of int; when it isn't, assume an invalid input in line with existing, similar cases. The path-orientated operators that appeared in PostgreSQL 9.3 and 9.4 do not call setPathArray(), and already independently take this precaution, so no change there. Peter Geoghegan
2015-06-12Fix failure to cover scalar-vs-rowtype cases in exec_stmt_return().Tom Lane
In commit 9e3ad1aac52454569393a947c06be0d301749362 I modified plpgsql to use exec_stmt_return's simple-variables fast path in more cases. However, I overlooked that there are really two different return conventions in use here, depending on whether estate->retistuple is true, and the existing fast-path code had only bothered to handle one of them. So trying to return a scalar in a function returning composite, or vice versa, could lead to unexpected error messages (typically "cache lookup failed for type 0") or to a null-pointer-dereference crash. In the DTYPE_VAR case, we can just throw error if retistuple is true, corresponding to what happens in the general-expression code path that was being used previously. (Perhaps someday both of these code paths should attempt a coercion, but today is not that day.) In the REC and ROW cases, just hand the problem to exec_eval_datum() when not retistuple. Also clean up the ROW coding slightly so it looks more like exec_eval_datum(). The previous commit also caused exec_stmt_return_next() to be used in more cases, but that code seems to be OK as-is. Per off-list report from Serge Rielau. This bug is new in 9.5 so no need to back-patch.
2015-06-12Improve error message and hint for ALTER COLUMN TYPE can't-cast failure.Tom Lane
We already tried to improve this once, but the "improved" text was rather off-target if you had provided a USING clause. Also, it seems helpful to provide the exact text of a suggested USING clause, so users can just copy-and-paste it when needed. Per complaint from Keith Rarick and a suggestion from Merlin Moncure. Back-patch to 9.2 where the current wording was adopted.
2015-06-12Make postmaster restart archiver soon after it dies, even during recovery.Fujii Masao
After the archiver dies, postmaster tries to start a new one immediately. But previously this could happen only while server was running normally even though archiving was enabled always (i.e., archive_mode was set to always). So the archiver running during recovery could not restart soon after it died. This is an oversight in commit ffd3774. This commit changes reaper(), postmaster's signal handler to cleanup after a child process dies, so that it tries to a new archiver even during recovery if necessary. Patch by me. Review by Alvaro Herrera.
2015-06-12Fixed some memory leaks in ECPG.Michael Meskes
Patch by Michael Paquier
2015-06-12Fix intoasc() in Informix compat lib. This function used to be a noop.Michael Meskes
Patch by Michael Paquier
2015-06-12Fix alphabetization in catalogs.sgml.Fujii Masao
System catalogs and views should be listed alphabetically in catalog.sgml, but only pg_file_settings view not. This patch also fixes typos in pg_file_settings comments.
2015-06-12Clean up useless mention of RMGRDESCSOURCES in pg_rewind Makefile.Fujii Masao
RMGRDESCSOURCES is defined and used only in pg_xlogdump Makefile, but pg_rewind Makefile mentioned it as extra files to remove in "make clean". This patch removes that useless mention from pg_rewind Makefile. Michael Paquier
2015-06-11release notes: add links to doc sectionsBruce Momjian
2015-06-11release notes: update hash itemBruce Momjian
Report by Tomas Vondra
2015-06-11release notes: move pg_buffercache item to the right sectionBruce Momjian
Report by Amit Langote
2015-06-11release notes: implement suggestionsBruce Momjian
Report by Michael Paquier
2015-06-11release notes: explain meaning of pg_stat_get_snapshot_timestamp()Bruce Momjian
Report by Michael Paquier
2015-06-11release notes: update for pg_basebackup in tar formatBruce Momjian
Report by Amit Kapila