- Apr 26, 2013
-
-
Joe Conway authored
Ensure that user created rows in extension tables get dumped if the table is explicitly requested, either with a -t/--table switch of the table itself, or by -n/--schema switch of the schema containing the extension table. Patch reviewed by Vibhor Kumar and Dimitri Fontaine. Backpatched to 9.1 when the extension management facility was added.
-
- Apr 25, 2013
-
-
Tom Lane authored
There was a high probability of two or more concurrent C.I.C. commands deadlocking just before completion, because each would wait for the others to release their reference snapshots. Fix by releasing the snapshot before waiting for other snapshots to go away. Per report from Paul Hinze. Back-patch to all active branches.
-
Heikki Linnakangas authored
Peter Geoghegan
-
- Apr 22, 2013
-
-
Peter Eisentraut authored
LANGUAGE 'plpgsql' no longer works. The single quotes need to be removed. Erwin Brandstetter
-
- Apr 20, 2013
-
-
Tom Lane authored
When creating or manipulating a cached plan for a transaction control command (particularly ROLLBACK), we must not perform any catalog accesses, since we might be in an aborted transaction. However, plancache.c busily saved or examined the search_path for every cached plan. If we were unlucky enough to do this at a moment where the path's expansion into schema OIDs wasn't already cached, we'd do some catalog accesses; and with some more bad luck such as an ill-timed signal arrival, that could lead to crashes or Assert failures, as exhibited in bug #8095 from Nachiket Vaidya. Fortunately, there's no real need to consider the search path for such commands, so we can just skip the relevant steps when the subject statement is a TransactionStmt. This is somewhat related to bug #5269, though the failure happens during initial cached-plan creation rather than revalidation. This bug has been there since the plan cache was invented, so back-patch to all supported branches.
-
- Apr 10, 2013
-
-
Magnus Hagander authored
Remove references to "one click", as we're not supposed to call them that anymore.
-
- Apr 07, 2013
-
-
Tom Lane authored
Per report from Jaime Casanova. Very curious that no one else has seen this failure ... but the code is clearly wrong as-is.
-
- Apr 05, 2013
-
-
Tom Lane authored
There's been some confusion expressed about this point, so clarify. Extended version of a patch by David Wheeler.
-
- Apr 04, 2013
-
-
Bruce Momjian authored
'strdup' the PSQLRC environment variable value before calling a routine that might free() it. Backpatch to 9.2, where the bug first appeared.
-
Heikki Linnakangas authored
Throw an error instead. Backpatch to all supported branches.
-
Heikki Linnakangas authored
The old formula didn't take into account that each WAL sender process needs a spinlock. We had also already exceeded the fixed number of spinlocks reserved for misc purposes (10). Bump that to 30. Backpatch to 9.0, where WAL senders were introduced. If I counted correctly, 9.0 had exactly 10 predefined spinlocks, and 9.1 exceeded that, but bump the limit in 9.0 too because 10 is uncomfortably close to the edge.
-
- Apr 03, 2013
-
-
Tom Lane authored
The point of turning off track_activities is to avoid this reporting overhead, but a thinko in commit 4f42b546 caused pgstat_report_activity() to perform half of its updates anyway. Fix that, and also make sure that we clear all the now-disabled fields when transitioning to the non-reporting state.
-
Tom Lane authored
Notice and complain about PQcancel() failures. Also, don't dump core if an error PGresult doesn't contain severity and message subfields, as it might not if it was generated by libpq itself. (We have a longstanding TODO item to improve that, but in the meantime isolationtester had better cope.) I tripped across the latter item while investigating a trouble report on buildfarm member spoonbill. As for the former, there's no evidence that PQcancel failure is actually involved in spoonbill's problem, but it still seems like a bad idea to ignore an error return code.
-
- Apr 01, 2013
-
-
Tom Lane authored
Security: CVE-2013-1899, CVE-2013-1901
-
Tom Lane authored
An oversight in commit e710b65c allowed database names beginning with "-" to be treated as though they were secure command-line switches; and this switch processing occurs before client authentication, so that even an unprivileged remote attacker could exploit the bug, needing only connectivity to the postmaster's port. Assorted exploits for this are possible, some requiring a valid database login, some not. The worst known problem is that the "-r" switch can be invoked to redirect the process's stderr output, so that subsequent error messages will be appended to any file the server can write. This can for example be used to corrupt the server's configuration files, so that it will fail when next restarted. Complete destruction of database tables is also possible. Fix by keeping the database name extracted from a startup packet fully separate from command-line switches, as had already been done with the user name field. The Postgres project thanks Mitsumasa Kondo for discovering this bug, Kyotaro Horiguchi for drafting the fix, and Noah Misch for recognizing the full extent of the danger. Security: CVE-2013-1899
-
Tom Lane authored
The pg_start_backup() and pg_stop_backup() functions checked the privileges of the initially-authenticated user rather than the current user, which is wrong. For example, a user-defined index function could successfully call these functions when executed by ANALYZE within autovacuum. This could allow an attacker with valid but low-privilege database access to interfere with creation of routine backups. Reported and fixed by Noah Misch. Security: CVE-2013-1901
-
Peter Eisentraut authored
-
Tom Lane authored
In commit 0f61d4dd, I added code to copy up column width estimates for each column of a subquery. That code supposed that the subquery couldn't have any output columns that didn't correspond to known columns of the current query level --- which is true when a query is parsed from scratch, but the assumption fails when planning a view that depends on another view that's been redefined (adding output columns) since the upper view was made. This results in an assertion failure or even a crash, as per bug #8025 from lindebg. Remove the Assert and instead skip the column if its resno is out of the expected range.
- Mar 31, 2013
-
-
Alvaro Herrera authored
-
Bruce Momjian authored
Now that pg_dump no longer dumps invalid indexes, per commit 683abc73, have pg_upgrade also skip them. Previously pg_upgrade threw an error if invalid indexes existed. Backpatch to 9.2, 9.1, and 9.0 (where pg_upgrade was added to git)
-
- Mar 30, 2013
-
-
Andrew Dunstan authored
Windows sometimes gets upset if we rename a large directory and then try to use the old name quickly, as seen in occasional buildfarm failures. So we avoid that by building the old version in the intended destination in the first place instead of renaming it, similar to the change made for the same reason in commit b7f8465c.
-
- Mar 29, 2013
-
-
Tom Lane authored
I changed this in commit fd15dba5, but missed the fact that the SGML documentation of the function specified exactly what it did. Well, one of the two places where it's specified documented that --- probably I looked at the other place and thought nothing needed to be done. Sync the two places where encode() and decode() are described.
-
Tom Lane authored
9.2 uses a kluge representation of "indislive"; we have to account for that when examining pg_index. Simplest solution is to check indisready for 9.0 and 9.1 as well; that's harmless though unnecessary, so it's not worth making a version distinction for. Fixes oversight in commit 683abc73, as noted by Andres Freund.
-
- Mar 28, 2013
-
-
Tom Lane authored
DST law changes in Chile, Haiti, Morocco, Paraguay, some Russian areas. Historical corrections for numerous places.
-
- Mar 27, 2013
-
-
Tom Lane authored
Previously, if the postmaster initialized OpenSSL's PRNG (which it will do when ssl=on in postgresql.conf), the same pseudo-random state would be inherited by each forked child process. The problem is masked to a considerable extent if the incoming connection uses SSL encryption, but when it does not, identical pseudo-random state is made available to functions like contrib/pgcrypto. The process's PID does get mixed into any requested random output, but on most systems that still only results in 32K or so distinct random sequences available across all Postgres sessions. This might allow an attacker who has database access to guess the results of "secure" operations happening in another session. To fix, forcibly reset the PRNG after fork(). Each child process that has need for random numbers from OpenSSL's generator will thereby be forced to go through OpenSSL's normal initialization sequence, which should provide much greater variability of the sequences. There are other ways we might do this that would be slightly cheaper, but this approach seems the most future-proof against SSL-related code changes. This has been assigned CVE-2013-1900, but since the issue and the patch have already been publicized on pgsql-hackers, there's no point in trying to hide this commit. Back-patch to all supported branches. Marko Kreen
-
Heikki Linnakangas authored
In a heap update, if the old and new tuple were on different pages, and the new page no longer existed (because it was subsequently truncated away by vacuum), heap_xlog_update forgot to release the pin on the old buffer. This bug was introduced by the "Fix multiple problems in WAL replay" patch, commit 3bbf668d (on master branch). With full_page_writes=off, this triggered an "incorrect local pin count" error later in replay, if the old page was vacuumed. This fixes bug #7969, reported by Yunong Xiao. Backpatch to 9.0, like the commit that introduced this bug.
-
- Mar 26, 2013
-
-
Tom Lane authored
Dumping invalid indexes can cause problems at restore time, for example if the reason the index creation failed was because it tried to enforce a uniqueness condition not satisfied by the table's data. Also, if the index creation is in fact still in progress, it seems reasonable to consider it to be an uncommitted DDL change, which pg_dump wouldn't be expected to dump anyway. Back-patch to all active versions, and teach them to ignore invalid indexes in servers back to 8.2, where the concept was introduced. Michael Paquier
-
- Mar 25, 2013
-
-
Heikki Linnakangas authored
If you have clusters of different versions pointing to the same tablespace location, we would incorrectly include all the data belonging to the other versions, too. Fixes bug #7986, reported by Sergey Burladyan.
-
Heikki Linnakangas authored
These programs don't work against 9.0 or earlier servers, so check that when the connection is made. That's better than a cryptic error message you got before. Also, these programs won't work with a 9.3 server, because the WAL streaming protocol was changed in a non-backwards-compatible way. As a general rule, we don't make any guarantee that an old client will work with a new server, so check that. However, allow a 9.1 client to connect to a 9.2 server, to avoid breaking environments that currently work; a 9.1 client happens to work with a 9.2 server, even though we didn't make any great effort to ensure that. This patch is for the 9.1 and 9.2 branches, I'll commit a similar patch to master later. Although this isn't a critical bug fix, it seems safe enough to back-patch. The error message you got when connecting to a 9.3devel server without this patch was cryptic enough to warrant backpatching.
-
- Mar 24, 2013
-
-
Tom Lane authored
Most (all?) of Russia has moved to what's effectively year-round daylight savings time, so that the "standard" zone names now mean an hour later than they used to. Update that, notably changing MSK as per recent complaint from Sergey Konoplev, but also CHOT, GET, IRKT, KGT, KRAT, MAGT, NOVT, OMST, VLAT, YAKT, YEKT. The corresponding DST abbreviations are presumably now obsolete, but I left them in place with their old definitions, just to reduce any possible breakage from this change. Also add VOLT (Europe/Volgograd), which for some reason we never had before, as well as MIST (Antarctica/Macquarie), and fix obsolete definitions of MAWT, TKT, and WST.
-
- Mar 23, 2013
-
-
Andrew Dunstan authored
This appears to cause some intermittent file system problems on Windows 8. Instead, set up the old data directory in its intended final location to start with.
-
Tom Lane authored
Doing that results in a broken index entry in PDF output. We had only a few like that, which is probably why nobody noticed before. Standardize on putting the <term> first. Josh Kupershmidt
-
- Mar 22, 2013
-
-
Tom Lane authored
If the remote database's settings of these GUCs are different from ours, ambiguous datetime values may be read incorrectly. To fix, temporarily adopt the remote server's settings while we ingest a query result. This is not a complete fix, since it doesn't do anything about ambiguous values in commands sent to the remote server; but there seems little we can do about that end of it given dblink's entirely textual API for transmitted commands. Back-patch to 9.2. The hazard exists in all versions, but this patch would need more work to apply before 9.2. Given the lack of field complaints about this issue, it doesn't seem worth the effort at present. Daniel Farina and Tom Lane
-
- Mar 18, 2013
-
-
Tom Lane authored
The docs showed that early-January dates can be considered part of the previous year for week-counting purposes, but failed to say explicitly that late-December dates can also be considered part of the next year. Fix that, and add a cross-reference to the "isoyear" field. Per bug #7967 from Pawel Kobylak.
-
- Mar 11, 2013
-
-
Tom Lane authored
When RETURNING is specified, ExecDelete would return a virtual-tuple slot that could contain pointers into an already-unpinned disk buffer. Another process could change the buffer contents before we get around to using the data, resulting in garbage results or even a crash. This seems of fairly low probability, which may explain why there are no known field reports of the problem, but it's definitely possible. Fix by forcing the result slot to be "materialized" before we release pin on the disk buffer. Back-patch to 9.0; in earlier branches there is no bug because ExecProcessReturning sent the tuple to the destination immediately. Also, this is already fixed in HEAD as part of the writable-foreign-tables patch (where the fix is necessary for DELETE RETURNING to work at all with postgres_fdw).
-
- Mar 07, 2013
-
-
Tom Lane authored
The previous coding of this function could get into situations where it would never terminate, because successive passes would re-add EMPTY arcs that had been removed by the previous pass. Rewrite the function completely using a new algorithm that is guaranteed to terminate, and also seems to be usually faster than the old one. Per Tcl bugs 3604074 and 3606683. Tom Lane and Don Porter
-
Heikki Linnakangas authored
If we were about to enter archive recovery after crash recovery, we scanned the archive for the latest tli history file, and set the recovery target timeline to that. However, when we actually tried to read the history file, we would not fetch the file from the archive, because we were not in archive recovery yet. To fix, make readTimeLineHistory and existsTimeLineHistory to always fetch the file from archive if archive recovery is requested, even if we're not in archive recovery yet. Backpatch to 9.2. Mitsumasa KONDO
-
Heikki Linnakangas authored
I missed to returns in the middle of ReadRecord function in my previous fix. If a WAL file was not found at all during crash recovery, XLogPageRead would return 'false', and ReadRecord would return without entering archive recovery. 9.2 only. In master, the code is structured differently and does not have this problem. Kyotaro HORIGUCHI, Mitsumasa KONDO and me.
-
- Mar 06, 2013
-
-
Andrew Dunstan authored
-