- Jul 19, 2013
-
-
Robert Haas authored
David Christensen
-
Michael Meskes authored
There are cases where the day of year value in struct tm is used, but it never got calculated. Problem found by Coverity scan.
-
Tom Lane authored
An ancient logic error in cfindloop() could cause the regex engine to fail to find matches that begin later than the start of the string. This function is only used when the regex pattern contains a back reference, and so far as we can tell the error is only reachable if the pattern is non-greedy (i.e. its first quantifier uses the ? modifier). Furthermore, the actual match must begin after some potential match that satisfies the DFA but then fails the back-reference's match test. Reported and fixed by Jeevan Chalke, with cosmetic adjustments by me.
-
- Jul 17, 2013
-
-
Stephen Frost authored
The documentation for ALTER VIEW had a minor copy-and-paste error in defining the parameters. Noticed when reviewing the WITH CHECK OPTION patch. Backpatch to 9.2 where this was first introduced.
-
- Jul 15, 2013
-
-
Stephen Frost authored
In pg_basebackup.c:reached_end_position(), we're reading from an internal pipe with our own background process but we're possibly reading more bytes than will actually fit into our buffer due to an off-by-one error. As we're reading from an internal pipe there's no real risk here, but it's good form to not depend on such convenient arrangements. Bug spotted by the Coverity scanner. Back-patch to 9.2 where this showed up.
-
- Jul 14, 2013
-
-
Stephen Frost authored
In tuplesort.c:inittapes(), we calculate tapeSpace by first figuring out how many 'tapes' we can use (maxTapes) and then multiplying the result by the tape buffer overhead for each. Unfortunately, when we are on a system with an 8-byte long, we allow work_mem to be larger than 2GB and that allows maxTapes to be large enough that the 32bit arithmetic can overflow when multiplied against the buffer overhead. When this overflow happens, we end up adding the overflow to the amount of space available, causing the amount of memory allocated to be larger than work_mem. Note that to reach this point, you have to set work mem to at least 24GB and be sorting a set which is at least that size. Given that a user who can set work_mem to 24GB could also set it even higher, if they were looking to run the system out of memory, this isn't considered a security issue. This overflow risk was found by the Coverity scanner. Back-patch to all supported branches, as this issue has existed since before 8.4.
-
- Jul 12, 2013
-
-
Michael Meskes authored
Thanks to MauMau <maumau307@gmail.com> for finding and fixing this.
-
- Jul 11, 2013
-
-
Bruce Momjian authored
Previously, pg_upgrade docs recommended using .pgpass if using MD5 authentication to avoid being prompted for a password. Turns out pg_ctl never prompts for a password, so MD5 requires .pgpass --- document that. Also recommend 'peer' for authentication too. Backpatch back to 9.1.
-
- Jul 08, 2013
-
-
Tom Lane authored
The code in set_append_rel_pathlist() for building parameterized paths for append relations (inheritance and UNION ALL combinations) supposed that the cheapest regular path for a child relation would still be cheapest when reparameterized. Which might not be the case, particularly if the added join conditions are expensive to compute, as in a recent example from Jeff Janes. Fix it to compare child path costs *after* reparameterizing. We can short-circuit that if the cheapest pre-existing path is already parameterized correctly, which seems likely to be true often enough to be worth checking for. Back-patch to 9.2 where parameterized paths were introduced.
-
- Jul 07, 2013
-
-
Magnus Hagander authored
Looks like a cut/paste error in the original addition of the file. Andres Freund
-
- Jul 06, 2013
-
-
Michael Meskes authored
-
- Jul 05, 2013
-
-
Magnus Hagander authored
Erikjan Rijkers
-
Michael Meskes authored
-
- Jul 03, 2013
-
-
Bruce Momjian authored
Improve documentation for usagecount and relforknumber. Backpatch to 9.3. Suggestion from Satoshi Nagayasu
-
- Jul 02, 2013
-
-
Alvaro Herrera authored
Make it easier for readers of the FP docs to find out about possibly truncated values. Per complaint from Tom Duffey in message F0E0F874-C86F-48D1-AA2A-0C5365BF5118@trillitech.com Author: Albe Laurenz Reviewed by: Abhijit Menon-Sen
-
Heikki Linnakangas authored
With -Wtype-limits, gcc correctly points out that size_t can never be < 0. Backpatch to 9.3 and 9.2. It's been like this forever, but in <= 9.1 you got a lot other warnings with -Wtype-limits anyway (at least with my version of gcc). Andres Freund
-
- Jun 27, 2013
-
-
Tom Lane authored
When there's a comment on an index that was created with UNIQUE or PRIMARY KEY constraint syntax, we need to label the comment as depending on the constraint not the index, since only the constraint object actually appears in the dump. This incorrect dependency can lead to parallel pg_restore trying to restore the comment before the index has been created, per bug #8257 from Lloyd Albin. This patch fixes pg_dump to produce the right dependency in dumps made in the future. Usually we also try to hack pg_restore to work around bogus dependencies, so that existing (wrong) dumps can still be restored in parallel mode; but that doesn't seem practical here since there's no easy way to relate the constraint dump entry to the comment after the fact. Andres Freund
-
Tom Lane authored
On Unix-ish platforms, EWOULDBLOCK may be the same as EAGAIN, which is *not* a success return, at least not on Linux. We need to treat it as a failure to avoid giving a misleading error message. Per the Single Unix Spec, only EINPROGRESS and EINTR returns indicate that the connection attempt is in progress. On Windows, on the other hand, EWOULDBLOCK (WSAEWOULDBLOCK) is the expected case. We must accept EINPROGRESS as well because Cygwin will return that, and it doesn't seem worth distinguishing Cygwin from native Windows here. It's not very clear whether EINTR can occur on Windows, but let's leave that part of the logic alone in the absence of concrete trouble reports. Also, remove the test for errno == 0, effectively reverting commit da9501bd, which AFAICS was just a thinko; or at best it might have been a workaround for a platform-specific bug, which we can hope is gone now thirteen years later. In any case, since libpq makes no effort to reset errno to zero before calling connect(), it seems unlikely that that test has ever reliably done anything useful. Andres Freund and Tom Lane
-
Tom Lane authored
Adjust the wording in the first para of "Sequence Manipulation Functions" so that neither of the link phrases in it break across line boundaries, in either A4- or US-page-size PDF output. This fixes a reported build failure for the 9.3beta2 A4 PDF docs, and future-proofs this particular para against causing similar problems in future. (Perhaps somebody will fix this issue in the SGML/TeX documentation tool chain someday, but I'm not holding my breath.) Back-patch to all supported branches, since the same problem could rise up to bite us in future updates if anyone changes anything earlier than this in func.sgml.
-
Noah Misch authored
Back-patch to all supported versions. Laurenz Albe
-
- Jun 25, 2013
-
-
Andrew Dunstan authored
In binary upgrade mode, we need to recreate and then drop dropped columns so that all the columns get the right attribute number. This is true for foreign tables as well as for native tables. For foreign tables we have been getting the first part right but not the second, leading to bogus columns in the upgraded database. Fix this all the way back to 9.1, where foreign tables were introduced.
-
Fujii Masao authored
In replication, when we shutdown the master, walsender tries to send all the outstanding WAL records to the standby, and then to exit. This basically means that all the WAL records are fully synced between two servers after the clean shutdown of the master. So, after promoting the standby to new master, we can restart the stopped master as new standby without the need for a fresh backup from new master. But there was one problem so far: though walsender tries to send all the outstanding WAL records, it doesn't wait for them to be replicated to the standby. Then, before receiving all the WAL records, walreceiver can detect the closure of connection and exit. We cannot guarantee that there is no missing WAL in the standby after clean shutdown of the master. In this case, backup from new master is required when restarting the stopped master as new standby. This patch fixes this problem. It just changes walsender so that it waits for all the outstanding WAL records to be replicated to the standby before closing the replication connection. Per discussion, this is a fix that needs to get backpatched rather than new feature. So, back-patch to 9.1 where enough infrastructure for this exists. Patch by me, reviewed by Andres Freund.
-
- Jun 23, 2013
-
-
Simon Riggs authored
In some cases with higher numbers of subtransactions it was possible for us to incorrectly initialize subtrans leading to complaints of missing pages. Bug report by Sergey Konoplev Analysis and fix by Andres Freund
-
- Jun 20, 2013
-
-
Peter Eisentraut authored
More languages than SQL and PL/pgSQL actually support parameter names.
-
- Jun 19, 2013
-
-
Kevin Grittner authored
In Danish collations, there are letter combinations which sort higher than 'Z'. A test for values > 'WA' was picking up rows where the value started with 'AA', causing the test to fail. Backpatch to 9.2, where the failing test was added. Per report from Svenne Krap and analysis by Jeff Janes
-
- Jun 18, 2013
-
-
Simon Riggs authored
ALTER TABLE .. VALIDATE CONSTRAINT previously gave incorrect details about lock levels and therefore incomplete reasons to use the option. Initial bug report and fix from Marko Tiikkaja Reworded by me to include comments by Kevin Grittner
-
- Jun 15, 2013
-
-
Fujii Masao authored
Back-patch to 9.1 where the directory archive was introduced.
-
- Jun 14, 2013
-
-
Tom Lane authored
SP-GiST's original scheme for avoiding deadlocks during concurrent index insertions doesn't work, as per report from Hailong Li, and there isn't any evident way to make it work completely. We could possibly lock individual inner tuples instead of their whole pages, but preliminary experimentation suggests that the performance penalty would be huge. Instead, if we fail to get a buffer lock while descending the tree, just restart the tree descent altogether. We keep the old tuple positioning rules, though, in hopes of reducing the number of cases where this can happen. Teodor Sigaev, somewhat edited by Tom Lane
-
- Jun 13, 2013
-
-
Tom Lane authored
In most scenarios a portal without a ResourceOwner is dead and not subject to any further execution, but a portal for a cursor WITH HOLD remains in existence with no ResourceOwner after the creating transaction is over. In this situation, if we attempt to "execute" the portal directly to fetch data from it, we were setting CurrentResourceOwner to NULL, leading to a segfault if the datatype output code did anything that required a resource owner (such as trying to fetch system catalog entries that weren't already cached). The case appears to be impossible to provoke with stock libpq, but psqlODBC at least is able to cause it when working with held cursors. Simplest fix is to just skip the assignment to CurrentResourceOwner, so that any resources used by the data output operations will be managed by the transaction-level resource owner instead. For consistency I changed all the places that install a portal's resowner as current, even though some of them are probably not reachable with a held cursor's portal. Per report from Joshua Berry (with thanks to Hiroshi Inoue for developing a self-contained test case). Back-patch to all supported versions.
-
- Jun 12, 2013
-
-
Robert Haas authored
Patch by me, reviewed by Tatsuo Ishii.
-
- Jun 11, 2013
-
-
Tom Lane authored
We need to increment the refcount on the composite type's cached tuple descriptor while we do lookups of its column types. Otherwise a cache flush could occur and release the tuple descriptor before we're done with it. This fails reliably with -DCLOBBER_CACHE_ALWAYS, but the odds of a failure in a production build seem rather low (since the pfree'd descriptor typically wouldn't get scribbled on immediately). That may explain the lack of any previous reports. Buildfarm issue noted by Christian Ullrich. Back-patch to 9.1 where the bogus code was added.
-
Tatsuo Ishii authored
lo_read()/lo_write() in libpq to avoid confusion.
-
- Jun 10, 2013
-
-
Joe Conway authored
getSchemaData() must identify extension member objects and mark them as not to be dumped. This must happen after reading all objects that can be direct members of extensions, but before we begin to process table subsidiary objects. Both rules and event triggers were wrong in this regard. Backport rules portion of patch to 9.1 -- event triggers do not exist prior to 9.3. Suggested fix by Tom Lane, initial complaint and patch by me.
-
Tom Lane authored
When the existing code here was written, it made sense to special-case RowExprs because that was the only way that we could handle row comparisons at all. Now that we have record_eq() and arrays of composites, the generic logic for "scalar" types will in fact work on RowExprs too, so there's no reason to throw error for combinations of RowExprs and other ways of forming composite values, nor to ignore the possibility of using a ScalarArrayOpExpr. But keep using the old logic when comparing two RowExprs, for consistency with the main transformAExprOp() logic. (This allows some cases with not-quite-identical rowtypes to succeed, so we might get push-back if we removed it.) Per bug #8198 from Rafal Rzepecki. Back-patch to all supported branches, since this works fine as far back as 8.4. Rafal Rzepecki and Tom Lane
-
- Jun 09, 2013
-
-
Tom Lane authored
Per discussion, this restriction isn't needed for any real security reason, and it seems to confuse people more often than it helps them. It could also result in some database states being unrestorable. So just drop it. Back-patch to 9.0, where ALTER DEFAULT PRIVILEGES was introduced.
-
Tom Lane authored
AllocateFile(), AllocateDir(), and some sister routines share a small array for remembering requests, so that the files can be closed on transaction failure. Previously that array had a fixed size, MAX_ALLOCATED_DESCS (32). While historically that had seemed sufficient, Steve Toutant pointed out that this meant you couldn't scan more than 32 file_fdw foreign tables in one query, because file_fdw depends on the COPY code which uses AllocateFile(). There are probably other cases, or will be in the future, where this nonconfigurable limit impedes users. We can't completely remove any such limit, at least not without a lot of work, since each such request requires a kernel file descriptor and most platforms limit the number we can have. (In principle we could "virtualize" these descriptors, as fd.c already does for the main VFD pool, but not without an additional layer of overhead and a lot of notational impact on the calling code.) But we can at least let the array size be configurable. Hence, change the code to allow up to max_safe_fds/2 allocated file requests. On modern platforms this should allow several hundred concurrent file_fdw scans, or more if one increases the value of max_files_per_process. To go much further than that, we'd need to do some more work on the data structure, since the current code for closing requests has potentially O(N^2) runtime; but it should still be all right for request counts in this range. Back-patch to 9.1 where contrib/file_fdw was introduced.
-
- Jun 08, 2013
-
-
Andrew Dunstan authored
Long-standing code has called tolower() on identifier character bytes with the high bit set. This is clearly an error and produces junk output when the encoding is multi-byte. This patch therefore restricts this activity to cases where there is a character with the high bit set AND the encoding is single-byte. There have been numerous gripes about this, most recently from Martin Schäfer. Backpatch to all live releases.
-
- Jun 07, 2013
-
-
Kevin Grittner authored
It claimed the value was always zero; it is really always -1. Per report from Hari Babu backpatch 734fbbd1 to 8.4
-
Tom Lane authored
Swap the order of a couple of phrases to clarify what the adjective "subsequent" applies to. Joshua Tolley
-
- Jun 06, 2013
-
-
Heikki Linnakangas authored
-