35862ff | Marc G. Fournier | 14 December 2010, 02:59:19 UTC | Tag 8.4.6. | 14 December 2010, 02:59:19 UTC |
0f311ae | Tom Lane | 14 December 2010, 01:22:01 UTC | Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. | 14 December 2010, 01:23:21 UTC |
9ee4b6f | Peter Eisentraut | 13 December 2010, 20:40:15 UTC | Translation updates for release 8.4.6 | 13 December 2010, 20:40:15 UTC |
8baa1db | Tom Lane | 13 December 2010, 17:41:57 UTC | Update time zone data files to tzdata release 2010o: DST law changes in Fiji and Samoa. Historical corrections for Hong Kong. | 13 December 2010, 17:42:40 UTC |
999e82c | Tom Lane | 10 December 2010, 16:33:38 UTC | Fix efficiency problems in tuplestore_trim(). The original coding in tuplestore_trim() was only meant to work efficiently in cases where each trim call deleted most of the tuples in the store. Which, in fact, was the pattern of the original usage with a Material node supporting mark/restore operations underneath a MergeJoin. However, WindowAgg now uses tuplestores and it has considerably less friendly trimming behavior. In particular it can attempt to trim one tuple at a time off a large tuplestore. tuplestore_trim() had O(N^2) runtime in this situation because of repeatedly shifting its tuple pointer array. Fix by avoiding shifting the array until a reasonably large number of tuples have been deleted. This can waste some pointer space, but we do still reclaim the tuples themselves, so the percentage wastage should be pretty small. Per Jie Li's report of slow percent_rank() evaluation. cume_dist() and ntile() would certainly be affected as well, along with any other window function that has a moving frame start and requires reading substantially ahead of the current row. Back-patch to 8.4, where window functions were introduced. There's no need to tweak it before that. | 10 December 2010, 16:34:36 UTC |
f3224e0 | Tom Lane | 09 December 2010, 01:01:19 UTC | Force default wal_sync_method to be fdatasync on Linux. Recent versions of the Linux system header files cause xlogdefs.h to believe that open_datasync should be the default sync method, whereas formerly fdatasync was the default on Linux. open_datasync is a bad choice, first because it doesn't actually outperform fdatasync (in fact the reverse), and second because we try to use O_DIRECT with it, causing failures on certain filesystems (e.g., ext4 with data=journal option). This part of the patch is largely per a proposal from Marti Raudsepp. More extensive changes are likely to follow in HEAD, but this is as much change as we want to back-patch. Also clean up confusing code and incorrect documentation surrounding the fsync_writethrough option. Those changes shouldn't result in any actual behavioral change, but I chose to back-patch them anyway to keep the branches looking similar in this area. In 9.0 and HEAD, also do some copy-editing on the WAL Reliability documentation section. Back-patch to all supported branches, since any of them might get used on modern Linux versions. | 09 December 2010, 01:01:19 UTC |
234ad01 | Tom Lane | 07 December 2010, 03:55:56 UTC | Add a stack overflow check to copyObject(). There are some code paths, such as SPI_execute(), where we invoke copyObject() on raw parse trees before doing parse analysis on them. Since the bison grammar is capable of building heavily nested parsetrees while itself using only minimal stack depth, this means that copyObject() can be the front-line function that hits stack overflow before anything else does. Accordingly, it had better have a check_stack_depth() call. I did a bit of performance testing and found that this slows down copyObject() by only a few percent, so the hit ought to be negligible in the context of complete processing of a query. Per off-list report from Toshihide Katayama. Back-patch to all supported branches. | 07 December 2010, 03:55:56 UTC |
6bd3753 | Tom Lane | 01 December 2010, 05:53:29 UTC | Prevent inlining a SQL function with multiple OUT parameters. There were corner cases in which the planner would attempt to inline such a function, which would result in a failure at runtime due to loss of information about exactly what the result record type is. Fix by disabling inlining when the function's recorded result type is RECORD. There might be some sub-cases where inlining could still be allowed, but this is a simple and backpatchable fix, so leave refinements for another day. Per bug #5777 from Nate Carson. Back-patch to all supported branches. 8.1 happens to avoid a core-dump here, but it still does the wrong thing. | 01 December 2010, 05:53:29 UTC |
61f8618 | Tom Lane | 26 November 2010, 20:21:00 UTC | Fix significant memory leak in contrib/xml2 functions. Most of the functions that execute XPath queries leaked the data structures created by libxml2. This memory would not be recovered until end of session, so it mounts up pretty quickly in any serious use of the feature. Per report from Pavel Stehule, though this isn't his patch. Back-patch to all supported branches. | 26 November 2010, 20:21:00 UTC |
ec66f65 | Itagaki Takahiro | 25 November 2010, 10:40:58 UTC | Don't raise "identifier will be truncated" messages in dblink except creating new connections. | 25 November 2010, 11:08:33 UTC |
fab2af3 | Tom Lane | 20 November 2010, 03:28:30 UTC | Fix leakage of cost_limit when multiple autovacuum workers are active. When using default autovacuum_vac_cost_limit, autovac_balance_cost relied on VacuumCostLimit to contain the correct global value ... but after the first time through in a particular worker process, it didn't, because we'd trashed it in previous iterations. Depending on the state of other autovac workers, this could result in a steady reduction of the effective cost_limit setting as a particular worker processed more and more tables, causing it to go slower and slower. Spotted by Simon Poole (bug #5759). Fix by saving and restoring the GUC variables in the loop in do_autovacuum. In passing, improve a few comments. Back-patch to 8.3 ... the cost rebalancing code has been buggy since it was put in. | 20 November 2010, 03:28:30 UTC |
7ff02ad | Heikki Linnakangas | 16 November 2010, 09:02:11 UTC | The GiST scan algorithm uses LSNs to detect concurrent pages splits, but temporary indexes are not WAL-logged. We used a constant LSN for temporary indexes, on the assumption that we don't need to worry about concurrent page splits in temporary indexes because they're only visible to the current session. But that assumption is wrong, it's possible to insert rows and split pages in the same session, while a scan is in progress. For example, by opening a cursor and fetching some rows, and INSERTing new rows before fetching some more. Fix by generating fake increasing LSNs, used in place of real LSNs in temporary GiST indexes. | 16 November 2010, 09:29:28 UTC |
7508d9d | Tom Lane | 15 November 2010, 19:27:04 UTC | Fix aboriginal mistake in plpython's set-returning-function support. We must stay in the function's SPI context until done calling the iterator that returns the set result. Otherwise, any attempt to invoke SPI features in the python code called by the iterator will malfunction. Diagnosis and patch by Jan Urbanski, per bug report from Jean-Baptiste Quenot. Back-patch to 8.2; there was no support for SRFs in previous versions of plpython. | 15 November 2010, 19:27:04 UTC |
2519b82 | Robert Haas | 15 November 2010, 02:27:34 UTC | Fix bug in cube picksplit algorithm. Alexander Korotkov | 15 November 2010, 02:28:33 UTC |
6318fa0 | Tom Lane | 14 November 2010, 20:57:51 UTC | Fix canAcceptConnections() bugs introduced by replication-related patches. We must not return any "okay to proceed" result code without having checked for too many children, else we might fail later on when trying to add the new child to one of the per-child state arrays. It's not clear whether this oversight explains Stefan Kaltenbrunner's recent report, but it could certainly produce a similar symptom. Back-patch to 8.4; the logic was not broken before that. | 14 November 2010, 20:57:51 UTC |
876cb81 | Tom Lane | 13 November 2010, 05:34:57 UTC | Add missing outfuncs.c support for struct InhRelation. This is needed to support debug_print_parse, per report from Jon Nelson. Cursory testing via the regression tests suggests we aren't missing anything else. | 13 November 2010, 05:34:57 UTC |
5c85d11 | Tom Lane | 12 November 2010, 20:14:51 UTC | Fix old oversight in const-simplification of COALESCE() expressions. Once we have found a non-null constant argument, there is no need to examine additional arguments of the COALESCE. The previous coding got it right only if the constant was in the first argument position; otherwise it tried to simplify following arguments too, leading to unexpected behavior like this: regression=# select coalesce(f1, 42, 1/0) from int4_tbl; ERROR: division by zero It's a minor corner case, but a bug is a bug, so back-patch all the way. | 12 November 2010, 20:18:27 UTC |
d434e8f | Heikki Linnakangas | 11 November 2010, 17:21:49 UTC | Fix bug introduced by the recent patch to check that the checkpoint redo location read from backup label file can be found: wasShutdown was set incorrectly when a backup label file was found. Jeff Davis, with a little tweaking by me. | 11 November 2010, 17:32:03 UTC |
5abb72f | Tom Lane | 10 November 2010, 21:51:39 UTC | Fix line_construct_pm() for the case of "infinite" (DBL_MAX) slope. This code was just plain wrong: what you got was not a line through the given point but a line almost indistinguishable from the Y-axis, although not truly vertical. The only caller that tries to use this function with m == DBL_MAX is dist_ps_internal for the case where the lseg is horizontal; it would end up producing the distance from the given point to the place where the lseg's line crosses the Y-axis. That function is used by other operators too, so there are several operators that could compute wrong distances from a line segment to something else. Per bug #5745 from jindiax. Back-patch to all supported branches. | 10 November 2010, 21:53:53 UTC |
f0e4331 | Tom Lane | 09 November 2010, 16:28:18 UTC | Repair memory leakage while ANALYZE-ing complex index expressions. The general design of memory management in Postgres is that intermediate results computed by an expression are not freed until the end of the tuple cycle. For expression indexes, ANALYZE has to re-evaluate each expression for each of its sample rows, and it wasn't bothering to free intermediate results until the end of processing of that index. This could lead to very substantial leakage if the intermediate results were large, as in a recent example from Jakub Ouhrabka. Fix by doing ResetExprContext for each sample row. This necessitates adding a datumCopy step to ensure that the final expression value isn't recycled too. Some quick testing suggests that this change adds at worst about 10% to the time needed to analyze a table with an expression index; which is annoying, but seems a tolerable price to pay to avoid unexpected out-of-memory problems. Back-patch to all supported branches. | 09 November 2010, 16:56:23 UTC |
7c0af83 | Heikki Linnakangas | 09 November 2010, 15:40:09 UTC | In rewriteheap.c (used by VACUUM FULL and CLUSTER), calculate the tuple length stored in the line pointer the same way it's calculated in the normal heap_insert() codepath. As noted by Jeff Davis, the length stored by raw_heap_insert() included padding but the one stored by the normal codepath did not. While the mismatch seems to be harmless, inconsistency isn't good, and the normal codepath has received a lot more testing over the years. Backpatch to 8.3 where the heap rewrite code was introduced. | 09 November 2010, 15:48:43 UTC |
658a630 | Tom Lane | 09 November 2010, 03:15:02 UTC | Fix error handling in temp-file deletion with log_temp_files active. The original coding in FileClose() reset the file-is-temp flag before unlinking the file, so that if control came back through due to an error, it wouldn't try to unlink the file twice. This was correct when written, but when the log_temp_files feature was added, the logging action was put in between those two steps. An error occurring during the logging action --- such as a query cancel --- would result in the unlink not getting done at all, as in recent report from Michael Glaesemann. To fix this, make sure that we do both the stat and the unlink before doing anything that could conceivably CHECK_FOR_INTERRUPTS. There is a judgment call here, which is which log message to emit first: if you can see only one, which should it be? I chose to log unlink failure at the risk of losing the log_temp_files log message --- after all, if the unlink does fail, the temp file is still there for you to see. Back-patch to all versions that have log_temp_files. The code was OK before that. | 09 November 2010, 03:15:02 UTC |
faa9007 | Tom Lane | 07 November 2010, 02:59:15 UTC | Add support for detecting register-stack overrun on IA64. Per recent investigation, the register stack can grow faster than the regular stack depending on compiler and choice of options. To avoid crashes we must check both stacks in check_stack_depth(). Back-patch to all supported versions. | 07 November 2010, 02:59:15 UTC |
78f0924 | Tom Lane | 03 November 2010, 17:42:04 UTC | Reduce recursion depth in recently-added regression test. Some buildfarm members fail the test with the original depth of 10 levels, apparently because they are running at the minimum max_stack_depth setting of 100kB and using ~ 10k per recursion level. While it might be interesting to try to figure out why they're eating so much stack, it isn't likely that any fix for that would be back-patchable. So just change the test to recurse only 5 levels. The extra levels don't prove anything correctness-wise anyway. | 03 November 2010, 17:42:04 UTC |
55c3a7c | Tom Lane | 02 November 2010, 22:45:50 UTC | Fix adjust_semi_join to be more cautious about clauseless joins. It was reporting that these were fully indexed (hence cheap), when of course they're the exact opposite of that. I'm not certain if the case would arise in practice, since a clauseless semijoin is hard to produce in SQL, but if it did happen we'd make some dumb decisions. | 02 November 2010, 22:45:50 UTC |
5ab15b5 | Tom Lane | 02 November 2010, 21:15:19 UTC | Ensure an index that uses a whole-row Var still depends on its table. We failed to record any dependency on the underlying table for an index declared like "create index i on t (foo(t.*))". This would create trouble if the table were dropped without previously dropping the index. To fix, simplify some overly-cute code in index_create(), accepting the possibility that sometimes the whole-table dependency will be redundant. Also document this hazard in dependency.c. Per report from Kevin Grittner. In passing, prevent a core dump in pg_get_indexdef() if the index's table can't be found. I came across this while experimenting with Kevin's example. Not sure it's a real issue when the catalogs aren't corrupt, but might as well be cautious. Back-patch to all supported versions. | 02 November 2010, 21:15:19 UTC |
f44b6fc | Tom Lane | 28 October 2010, 17:01:07 UTC | Fix plpgsql's handling of "simple" expression evaluation. In general, expression execution state trees aren't re-entrantly usable, since functions can store private state information in them. For efficiency reasons, plpgsql tries to cache and reuse state trees for "simple" expressions. It can get away with that most of the time, but it can fail if the state tree is dirty from a previous failed execution (as in an example from Alvaro) or is being used recursively (as noted by me). Fix by tracking whether a state tree is in use, and falling back to the "non-simple" code path if so. This results in a pretty considerable speed hit when the non-simple path is taken, but the available alternatives seem even more unpleasant because they add overhead in the simple path. Per idea from Heikki. Back-patch to all supported branches. | 28 October 2010, 17:02:53 UTC |
61ba6f4 | Heikki Linnakangas | 27 October 2010, 17:03:00 UTC | Fix long-standing segfault when accept() or one of the calls made right after accepting a connection fails, and the server is compiled with GSSAPI support. Report and patch by Alexander V. Chernikov, bug #5731. | 27 October 2010, 17:07:55 UTC |
b788875 | Heikki Linnakangas | 26 October 2010, 18:15:42 UTC | Before removing backup_label and irrevocably changing pg_control file, check that WAL file containing the checkpoint redo-location can be found. This avoids making the cluster irrecoverable if the redo location is in an earlie WAL file than the checkpoint record. Report, analysis and patch by Jeff Davis, with small changes by me. | 26 October 2010, 18:41:49 UTC |
4a75c7f | Heikki Linnakangas | 20 October 2010, 19:20:33 UTC | If pk is NULL, the backend would segfault when accessing ->algo and the following NULL check was never reached. This problem was found by Coccinelle (null_ref.cocci from coccicheck). Marti Raudsepp | 20 October 2010, 19:24:55 UTC |
d4346e1 | Tom Lane | 20 October 2010, 04:55:07 UTC | Fix ecpg test building process to not generate *.dSYM junk on Macs. The trick is to not try to build executables directly from .c files, but to always build the intermediate .o files. For obscure reasons, Darwin's version of gcc will leave debug cruft behind in the first case but not the second. Per complaint from Robert Haas. | 20 October 2010, 04:55:07 UTC |
d94d0a8 | Bruce Momjian | 19 October 2010, 15:49:53 UTC | Add mention of using tools/fsync to test fsync methods. Restructure recent wal_sync_method doc paragraph to be clearer. | 19 October 2010, 15:49:53 UTC |
e6e906a | Robert Haas | 14 October 2010, 23:12:24 UTC | Add pg_user_mappings to the table of system views. | 14 October 2010, 23:13:27 UTC |
d833f42 | Peter Eisentraut | 14 October 2010, 17:36:42 UTC | Complete the documentation of the USAGE privilege for foreign servers The GRANT reference page failed to mention that the USAGE privilege allows modifying associated user mappings, although this was already documented on the CREATE/ALTER/DROP USER MAPPING pages. | 14 October 2010, 17:38:48 UTC |
a0e02dc | Michael Meskes | 14 October 2010, 15:51:53 UTC | Applied patch by Itagaki Takahiro to fix incorrect status calculation in ecpglib. Instead of parsing the statement just as ask the database server. | 14 October 2010, 15:51:53 UTC |
9dfd308 | Tom Lane | 11 October 2010, 23:04:53 UTC | Fix assorted bugs in GIN's WAL replay logic. The original coding was quite sloppy about handling the case where XLogReadBuffer fails (because the page has since been deleted). This would result in either "bad buffer id: 0" or an Assert failure during replay, if indeed the page were no longer there. In a couple of places it also neglected to check whether the change had already been applied, which would probably result in corrupted index contents. I believe that bug #5703 is an instance of the first problem. These issues could show up without replication, but only if you were unfortunate enough to crash between modification of a GIN index and the next checkpoint. Back-patch to 8.2, which is as far back as GIN has WAL support. | 11 October 2010, 23:04:53 UTC |
444a726 | Robert Haas | 08 October 2010, 13:15:17 UTC | Warn that views can be safely used to hide columns, but not rows. | 08 October 2010, 13:16:20 UTC |
36f4b4e | Robert Haas | 07 October 2010, 16:19:03 UTC | Improve WAL reliability documentation, and add more cross-references to it. In particular, we are now more explicit about the fact that you may need wal_sync_method=fsync_writethrough for crash-safety on some platforms, including MaxOS X. There's also now an explicit caution against assuming that the default setting of wal_sync_method is either crash-safe or best for performance. | 07 October 2010, 16:22:08 UTC |
9e718e6 | Tom Lane | 03 October 2010, 00:02:41 UTC | Behave correctly if INSERT ... VALUES is decorated with additional clauses. In versions 8.2 and up, the grammar allows attaching ORDER BY, LIMIT, FOR UPDATE, or WITH to VALUES, and hence to INSERT ... VALUES. But the special-case code for VALUES in transformInsertStmt() wasn't expecting any of those, and just ignored them, leading to unexpected results. Rather than complicate the special-case path, just ensure that the presence of any of those clauses makes us treat the query as if it had a general SELECT. Per report from Hitoshi Harada. | 03 October 2010, 00:02:41 UTC |
4b1501c | Tom Lane | 02 October 2010, 22:40:28 UTC | Remove excess argument to open(2). Many compilers don't complain about this, but some do, and it's certainly wrong. Back-patch to 8.4 where the error was introduced. Mark Kirkwood | 02 October 2010, 22:40:57 UTC |
2f76a4b | Marc G. Fournier | 01 October 2010, 13:35:31 UTC | Tag 8.4.5 | 01 October 2010, 13:35:31 UTC |
b805be2 | Tom Lane | 30 September 2010, 21:20:25 UTC | Use a separate interpreter for each calling SQL userid in plperl and pltcl. There are numerous methods by which a Perl or Tcl function can subvert the behavior of another such function executed later; for example, by redefining standard functions or operators called by the target function. If the target function is SECURITY DEFINER, or is called by such a function, this means that any ordinary SQL user with Perl or Tcl language usage rights can do essentially anything with the privileges of the target function's owner. To close this security hole, create a separate Perl or Tcl interpreter for each SQL userid under which plperl or pltcl functions are executed within a session. However, all plperlu or pltclu functions run within a session still share a single interpreter, since they all execute at the trust level of a database superuser anyway. Note: this change results in a functionality loss when libperl has been built without the "multiplicity" option: it's no longer possible to call plperl functions under different userids in one session, since such a libperl can't support multiple interpreters in one process. However, such a libperl already failed to support concurrent use of plperl and plperlu, so it's likely that few people use such versions with Postgres. Security: CVE-2010-3433 | 30 September 2010, 21:20:25 UTC |
1100d1e | Peter Eisentraut | 30 September 2010, 20:31:19 UTC | Translation updates for 8.4.5 | 30 September 2010, 20:31:19 UTC |
b8ba9a2 | Tom Lane | 30 September 2010, 18:27:36 UTC | Update release notes for releases 9.0.1, 8.4.5, 8.3.12, 8.2.18, 8.1.22, 8.0.26, and 7.4.30. | 30 September 2010, 18:27:36 UTC |
e8b57ba | Tom Lane | 28 September 2010, 18:47:25 UTC | Fix another small oversight in command_no_begin patch. Need a "return false" to prevent tests from continuing after we've moved the "query" pointer. As it stood, it'd accept "DROP DISCARD ALL" as a match. | 28 September 2010, 18:48:32 UTC |
dc9cc88 | Tom Lane | 28 September 2010, 18:15:42 UTC | Fix PlaceHolderVar mechanism's interaction with outer joins. The point of a PlaceHolderVar is to allow a non-strict expression to be evaluated below an outer join, after which its value bubbles up like a Var and can be forced to NULL when the outer join's semantics require that. However, there was a serious design oversight in that, namely that we didn't ensure that there was actually a correct place in the plan tree to evaluate the placeholder :-(. It may be necessary to delay evaluation of an outer join to ensure that a placeholder that should be evaluated below the join can be evaluated there. Per recent bug report from Kirill Simonov. Back-patch to 8.4 where the PlaceHolderVar mechanism was introduced. | 28 September 2010, 18:15:42 UTC |
2dc2ea8 | Itagaki Takahiro | 28 September 2010, 06:57:19 UTC | Only DISCARD ALL should be in the command_no_begin list. We allowes DISCARD PLANS and TEMP in a transaction. | 28 September 2010, 06:57:19 UTC |
b66c4fb | Itagaki Takahiro | 28 September 2010, 05:26:03 UTC | Add DISCARD to the command_no_begin list for AUTOCOMMIT=off. Backpatch to 8.3. Reported by Sergey Burladyan. | 28 September 2010, 05:26:03 UTC |
78b0a0d | Tom Lane | 25 September 2010, 19:57:05 UTC | Further fixes to the pg_get_expr() security fix in back branches. It now emerges that the JDBC driver expects to be able to use pg_get_expr() on an output of a sub-SELECT. So extend the check logic to be able to recurse into a sub-SELECT to see if the argument is ultimately coming from an appropriate column. Per report from Thomas Kellerer. | 25 September 2010, 20:02:32 UTC |
76833ae | Tom Lane | 24 September 2010, 17:48:26 UTC | Still more .gitignore cleanup. Fix overly-enthusiastic ignores, as identified by git ls-files -i --exclude-standard | 24 September 2010, 17:48:26 UTC |
328539f | Robert Haas | 24 September 2010, 02:00:26 UTC | Add contrib/xml2/pgxml.sql to .gitignore Kevin Grittner | 24 September 2010, 02:08:27 UTC |
63dcb45 | Tom Lane | 23 September 2010, 20:53:28 UTC | Prevent show_session_authorization from crashing when session_authorization hasn't been set. The only known case where this can happen is when show_session_authorization is invoked in an autovacuum process, which is possible if an index function calls it, as for example in bug #5669 from Andrew Geery. We could perhaps try to return a sensible value, such as the name of the cluster-owning superuser; but that seems like much more trouble than the case is worth, and in any case it could create new possible failure modes. Simply returning an empty string seems like the most appropriate fix. Back-patch to all supported versions, even those before autovacuum, just in case there's another way to provoke this crash. | 23 September 2010, 20:53:28 UTC |
cd198f8 | Tom Lane | 23 September 2010, 23:34:56 UTC | Avoid sharing subpath list structure when flattening nested AppendRels. In some situations the original coding led to corrupting the child AppendRel's subpaths list, effectively adding other members of the parent's list to it. This was usually masked because we never made any further use of the child's list, but given the right combination of circumstances, we could do so. The visible symptom would be a relation getting scanned twice, as in bug #5673 from David Schmitt. Backpatch to 8.2, which is as far back as the risky coding appears. The example submitted by David only fails in 8.4 and later, but I'm not convinced that there aren't any even-more-obscure cases where 8.2 and 8.3 would fail. | 23 September 2010, 19:40:34 UTC |
be62206 | Heikki Linnakangas | 23 September 2010, 11:49:00 UTC | Initialize tableoid field correctly when dumping foreign data wrappers and servers. AFAICT it's harmless at the moment because nothing can depend on either, but as soon as we introduce an object type with such dependencies, tableoid needs to be set or pg_dump will fail to interpret the dependencies correctly. In theory, I guess the uninitialized garbage in tableoid could cause the object to be mistaken for some other object with same OID as well. | 23 September 2010, 12:00:08 UTC |
fcb2326 | Tom Lane | 23 September 2010, 03:48:20 UTC | Re-allow input of Julian dates prior to 0001-01-01 AD. This was unintentionally broken in 8.4 while tightening up checking of ordinary non-Julian date inputs to forbid references to "year zero". Per bug #5672 from Benjamin Gigot. | 23 September 2010, 03:48:20 UTC |
41b04fa | Tom Lane | 23 September 2010, 02:32:30 UTC | More fixes for libpq's .gitignore file. The previous patches failed to cover a lot of symlinks that are only added in platform-specific cases. Make the lists match what's in the Makefile for each branch. | 23 September 2010, 02:32:30 UTC |
37d52dd | Tom Lane | 23 September 2010, 00:22:42 UTC | Do some copy-editing on the Git usage docs. | 23 September 2010, 00:22:42 UTC |
c69bdbd | Tom Lane | 22 September 2010, 22:26:13 UTC | Fix documentation gitignore for pre-9.0 doc build methods. | 22 September 2010, 22:26:13 UTC |
316a689 | Tom Lane | 22 September 2010, 21:22:06 UTC | Some more gitignore cleanups: cover contrib and PL regression test outputs. Also do some further work in the back branches, where quite a bit wasn't covered by Magnus' original back-patch. | 22 September 2010, 21:23:00 UTC |
2792c82 | Magnus Hagander | 22 September 2010, 19:49:09 UTC | Add gitignore files for ecpg regression tests. Backpatch to 8.2 as that's how far the structure looks the same. | 22 September 2010, 19:49:09 UTC |
35b2f93 | Magnus Hagander | 22 September 2010, 18:10:32 UTC | Remove anonymous cvs instructions, and replace them with instructions for git. Change other references from cvs to git as well. | 22 September 2010, 18:10:32 UTC |
40f34ec | Magnus Hagander | 22 September 2010, 10:57:08 UTC | Convert cvsignore to gitignore, and add .gitignore for build targets. | 22 September 2010, 10:57:08 UTC |
c629951 | Tom Lane | 21 September 2010, 18:43:06 UTC | Back-patch replacement of README.CVS with README.git. In older branches, also git-ify the "make distdir" rule. | 21 September 2010, 18:43:06 UTC |
0af6a87 | Magnus Hagander | 16 September 2010, 20:37:16 UTC | Treat exit code 128 (ERROR_WAIT_NO_CHILDREN) as non-fatal on Win32, since it can happen when a process fails to start when the system is under high load. Per several bug reports and many peoples investigation. Back-patch to 8.4, which is as far back as the "deadman-switch" for shared memory access exists. | 16 September 2010, 20:37:16 UTC |
e0664d5 | Tom Lane | 02 September 2010, 03:16:59 UTC | Fix up flushing of composite-type typcache entries to be driven directly by SI invalidation events, rather than indirectly through the relcache. In the previous coding, we had to flush a composite-type typcache entry whenever we discarded the corresponding relcache entry. This caused problems at least when testing with RELCACHE_FORCE_RELEASE, as shown in recent report from Jeff Davis, and might result in real-world problems given the kind of unexpected relcache flush that that test mechanism is intended to model. The new coding decouples relcache and typcache management, which is a good thing anyway from a structural perspective. The cost is that we have to search the typcache linearly to find entries that need to be flushed. There are a couple of ways we could avoid that, but at the moment it's not clear it's worth any extra trouble, because the typcache contains very few entries in typical operation. Back-patch to 8.2, the same as some other recent fixes in this general area. The patch could be carried back to 8.0 with some additional work, but given that it's only hypothetical whether we're fixing any problem observable in the field, it doesn't seem worth the work now. | 02 September 2010, 03:16:59 UTC |
27fddba | Tom Lane | 29 August 2010, 19:33:29 UTC | Reduce PANIC to ERROR in some occasionally-reported btree failure cases. This patch changes _bt_split() and _bt_pagedel() to throw a plain ERROR, rather than PANIC, for several cases that are reported from the field from time to time: * right sibling's left-link doesn't match; * PageAddItem failure during _bt_split(); * parent page's next child isn't right sibling during _bt_pagedel(). In addition the error messages for these cases have been made a bit more verbose, with additional values included. The original motivation for PANIC here was to capture core dumps for subsequent analysis. But with so many users whose platforms don't capture core dumps by default, or who are unprepared to analyze them anyway, it's hard to justify a forced database restart when we can fairly easily detect the problems before we've reached the critical sections where PANIC would be necessary. It is not currently known whether the reports of these messages indicate well-hidden bugs in Postgres, or are a result of storage-level malfeasance; the latter possibility suggests that we ought to try to be more robust even if there is a bug here that's ultimately found. Backpatch to 8.2. The code before that is sufficiently different that it doesn't seem worth the trouble to back-port further. | 29 August 2010, 19:33:29 UTC |
d321ff1 | Tom Lane | 29 August 2010, 15:19:19 UTC | Remove obsolete remark that PQprepare() is more flexible than PREPARE. Spotted by Dmitriy Igrishin. Back-patch to 8.2, which is when the PREPARE statement was improved to allow parameter types to be omitted. | 29 August 2010, 15:19:19 UTC |
27c6b58 | Tom Lane | 26 August 2010, 19:59:00 UTC | Update time zone data files to tzdata release 2010l: DST law changes in Egypt and Palestine. Added new names for two Micronesian timezones: Pacific/Chuuk is now preferred over Pacific/Truk (and the preferred abbreviation is CHUT not TRUT) and Pacific/Pohnpei is preferred over Pacific/Ponape. Historical corrections for Finland. | 26 August 2010, 19:59:00 UTC |
bb70ac8 | Tom Lane | 26 August 2010, 18:54:52 UTC | Fix ExecMakeTableFunctionResult to verify that all rows returned by a SRF returning "record" actually do have the same rowtype. This is needed because the parser can't realistically enforce that they will all have the same typmod, as seen in a recent example from David Wheeler. Back-patch to 8.0, which is as far back as we have the notion of RECORD subtypes being distinguished by typmod. Wheeler's example depends on 8.4-and-up features, but I suspect there may be ways to provoke similar failures before 8.4. | 26 August 2010, 18:54:52 UTC |
7499831 | Peter Eisentraut | 25 August 2010, 19:37:48 UTC | Catch null pointer returns from PyCObject_AsVoidPtr and PyCObject_FromVoidPtr This is reproducibly possible in Python 2.7 if the user turned PendingDeprecationWarning into an error, but it's theoretically also possible in earlier versions in case of exceptional conditions. backpatched to 8.0 | 25 August 2010, 19:37:48 UTC |
01faed3 | Tom Lane | 21 August 2010, 13:59:58 UTC | Improve parallel restore's ability to cope with selective restore (-L option). The original coding tended to break down in the face of modified restore orders, as shown in bug #5626 from Albert Ullrich, because it would flip over into parallel-restore operation too soon. That causes problems because we don't have sufficient dependency information in dump archives to allow safe parallel processing of SECTION_PRE_DATA items. Even if we did, it's probably undesirable to allow that to override the commanded restore order. To fix the problem of omitted items causing unexpected changes in restore order, tweak SortTocFromFile so that omitted items end up at the head of the list not the tail. This ensures that they'll be examined and their dependencies will be marked satisfied before we get to any interesting items. In HEAD and 9.0, we can easily change restore_toc_entries_parallel so that all SECTION_PRE_DATA items are guaranteed to be processed in the initial serial-restore loop, and hence in commanded order. Only DATA and POST_DATA items are candidates for parallel processing. For them there might be variations from the commanded order because of parallelism, but we should do it in a safe order thanks to dependencies. In 8.4 it's much harder to make such a guarantee. I settled for not letting the initial loop break out into parallel processing mode if it sees a DATA/POST_DATA item that's not to be restored; this at least prevents a non-restorable item from causing premature exit from the loop. This means that 8.4 will be more likely to fail given a badly-ordered -L list than 9.x, but we don't really promise any such thing will work anyway. | 21 August 2010, 13:59:58 UTC |
affcd50 | Tom Lane | 19 August 2010, 18:58:11 UTC | Allow USING and INTO clauses of plpgsql's EXECUTE to appear in either order. Aside from being more forgiving, this prevents a rather surprising misbehavior when the "wrong" order was used: the old code didn't throw a syntax error, but absorbed the INTO clause into the last USING expression, which then did strange things downstream. Intentionally not changing the documentation; we'll continue to advertise only the "standard" clause order. Backpatch to 8.4, where the USING clause was added to EXECUTE. | 19 August 2010, 18:58:11 UTC |
a1bde80 | Tom Lane | 19 August 2010, 18:11:02 UTC | Keep exec_simple_check_plan() from thinking "SELECT foo INTO bar" is simple. It's not clear if this situation can occur in plpgsql other than via the EXECUTE USING case Heikki illustrated, which I will shortly close off. However, ignoring the intoClause if it's there is surely wrong, so let's patch it for safety. Backpatch to 8.3, which is as far back as this code has a PlannedStmt to deal with. There might be another way to make an equivalent test before that, but since this is just preventing hypothetical bugs, I'm not going to obsess about it. | 19 August 2010, 18:11:02 UTC |
f958310 | Tom Lane | 19 August 2010, 17:31:56 UTC | Be a bit less cavalier with both the code and the comment for UNKNOWN fix. | 19 August 2010, 17:31:56 UTC |
075abb1 | Heikki Linnakangas | 19 August 2010, 16:54:51 UTC | Revert patch to coerce 'unknown' type parameters in the backend. As Tom pointed out, it would need a 2nd pass after the whole query is processed to correctly check that an unknown Param is coerced to the same target type everywhere. Adding the 2nd pass would add a lot more code, which doesn't seem worth the risk given that there isn't much of a use case for passing unknown Params in the first place. The code would work without that check, but it might be confusing and the behavior would be different from the varparams case. Instead, just coerce all unknown params in a PL/pgSQL USING clause to text. That's simple, and is usually what users expect. Revert the patch in CVS HEAD and master, and backpatch the new solution to 8.4. Unlike the previous solution, this applies easily to 8.4 too. | 19 August 2010, 16:54:51 UTC |
fd91b7d | Tom Lane | 19 August 2010, 15:46:30 UTC | Fix possible corruption of AfterTriggerEventLists in subtransaction rollback. afterTriggerInvokeEvents failed to adjust events->tailfree when truncating the last chunk of an event list. This could result in the data being "de-truncated" by afterTriggerRestoreEventList during a subsequent subtransaction abort. Even that wouldn't kill us, because the re-added data would just be events marked DONE --- unless the data had been partially overwritten by new events. Then we might crash, or in any case misbehave (perhaps fire triggers twice, or fire triggers with the wrong event data). Per bug #5622 from Thue Janus Kristensen. Back-patch to 8.4 where the current trigger list representation was introduced. | 19 August 2010, 15:46:30 UTC |
8a28869 | Tom Lane | 18 August 2010, 15:22:09 UTC | Add missing handling of PlannedStmt.transientPlan in copyfuncs/outfuncs. _outPlannedStmt is only debug support, so the omission there was not very serious, but the omission in _copyPlannedStmt is a real bug. The consequence would be that a copied plan tree would never be marked as a transient plan, so that we would forget we ought to replan it after some not-yet-ready index becomes ready for use. This might explain some past complaints about indexes created with CREATE INDEX CONCURRENTLY not being used right away. Problem spotted by Yeb Havinga. Back-patch to 8.3, where the field was added. | 18 August 2010, 15:22:09 UTC |
b9b65b7 | Michael Meskes | 17 August 2010, 09:41:49 UTC | Applied Zoltan's patch to fix a few memleaks in ecpg's pgtypeslib. | 17 August 2010, 09:41:49 UTC |
0b77050 | Peter Eisentraut | 17 August 2010, 04:49:33 UTC | Backpatch some blatant spelling mistakes | 17 August 2010, 04:49:33 UTC |
e74ced8 | Tom Lane | 16 August 2010, 17:33:01 UTC | Arrange to fsync the contents of lockfiles (both postmaster.pid and the socket lockfile) when writing them. The lack of an fsync here may well explain two different reports we've seen of corrupted lockfile contents, which doesn't particularly bother the running server but can prevent a new server from starting if the old one crashes. Per suggestion from Alvaro. Back-patch to all supported versions. | 16 August 2010, 17:33:01 UTC |
00fb7f5 | Tom Lane | 16 August 2010, 00:06:31 UTC | Fix psql's copy of utf2ucs() to match the backend's copy exactly; in particular, propagate a fix in the test to see whether a UTF8 character has length 4 bytes. This is likely of little real-world consequence because 5-or-more-byte UTF8 sequences are not supported by Postgres nor seen anywhere in the wild, but still we may as well get it right. Problem found by Joseph Adams. Bug is aboriginal, so back-patch all the way. | 16 August 2010, 00:06:31 UTC |
7f4de11 | Robert Haas | 15 August 2010, 01:57:21 UTC | Add link and additional index reference to pgcrypto. Kevin Grittner, with markup adjustments. | 15 August 2010, 01:57:21 UTC |
286fa73 | Tom Lane | 14 August 2010, 15:47:30 UTC | Fix planner to make a reasonable assumption about the amount of memory space used by array_agg(), string_agg(), and similar aggregate functions that use "internal" as their transition datatype. The previous coding thought this took *no* extra space, since "internal" is pass-by-value; but actually these aggregates typically consume a great deal of space. Per bug #5608 from Itagaki Takahiro, and fix suggestion from Hitoshi Harada. Back-patch to 8.4, where array_agg was introduced. | 14 August 2010, 15:47:30 UTC |
dd56a9d | Tom Lane | 13 August 2010, 16:27:28 UTC | Fix Assert failure in PushOverrideSearchPath when trying to restore a search path that specifies useTemp, but there is no active temp schema in the current session. (This can happen if the path was saved during a transaction that created a temp schema and was later rolled back.) For existing callers it's sufficient to ignore the useTemp flag in this case, though we might later want to offer an option to create a fresh temp schema. So far as I can tell this is just an Assert failure: in a non-assert build, the code would push a zero onto the new search path, which is useless but not very harmful. Per bug report from Heikki. Back-patch to 8.3; prior versions don't have this code. | 13 August 2010, 16:27:28 UTC |
86003b8 | Robert Haas | 11 August 2010, 19:03:36 UTC | Fix one more incorrect errno definition in the ECPG manual. Again, back-patch all the way to 7.4. | 11 August 2010, 19:03:36 UTC |
64ddabc | Robert Haas | 11 August 2010, 18:52:23 UTC | Fix incorrect errno definitions in ECPG manual. ecpgerrno.h hasn't materially changed since PostgreSQL 7.4, so this has been wrong for a very long time. Back-patch all the way. Satoshi Nagayasu | 11 August 2010, 18:52:23 UTC |
206a42a | Robert Haas | 10 August 2010, 02:57:19 UTC | Use double quotes rather than double quotes for libpq target anchors. Per observation from Tom Lane that the previous patch to these files was not consistent with what is done elsewhere in the docs. | 10 August 2010, 02:57:19 UTC |
63c232b | Tom Lane | 09 August 2010, 18:50:29 UTC | Fix incorrect logic in plpgsql for cleanup after evaluation of non-simple expressions. We need to deal with this when handling subscripts in an array assignment, and also when catching an exception. In an Assert-enabled build these omissions led to Assert failures, but I think in a normal build the only consequence would be short-term memory leakage; which may explain why this wasn't reported from the field long ago. Back-patch to all supported versions. 7.4 doesn't have exceptions, but otherwise these bugs go all the way back. Heikki Linnakangas and Tom Lane | 09 August 2010, 18:50:29 UTC |
4e49ea0 | Robert Haas | 09 August 2010, 12:00:53 UTC | Provide stable target anchors for libpq functions. Daniele Varrazzo | 09 August 2010, 12:00:53 UTC |
ec31e97 | Peter Eisentraut | 06 August 2010, 20:09:00 UTC | Fix indexterm spelling | 06 August 2010, 20:09:00 UTC |
a6542f9 | Robert Haas | 03 August 2010, 15:47:16 UTC | Fix inheritance count tracking in ALTER TABLE .. ADD CONSTRAINT. Without this patch, constraints inherited by children of a parent table which itself has multiple inheritance parents can end up with the wrong coninhcount. After dropping the constraint, the children end up with a leftover copy of the constraint that is not dumped and cannot be dropped. There is a similar problem with ALTER TABLE .. ADD COLUMN, but that looks significantly more difficult to resolve, so I'm committing this fix separately. Back-patch to 8.4, which is the first release that has coninhcount. Report by Hank Enting. | 03 August 2010, 15:47:16 UTC |
9f4b99a | Tom Lane | 03 August 2010, 00:10:52 UTC | Fix core dump in QTNodeCompare when tsquery_cmp() is applied to two empty tsqueries. CompareTSQ has to have a guard for the case rather than blindly applying QTNodeCompare to random data past the end of the datums. Also, change QTNodeCompare to be a little less trusting: use an actual test rather than just Assert'ing that the input is sane. Problem encountered while investigating another issue (I saw a core dump in autoanalyze on a table containing multiple empty tsquery values). Back-patch to all branches with tsquery support. In HEAD, also fix some bizarre (though not outright wrong) coding in tsq_mcontains(). | 03 August 2010, 00:10:52 UTC |
c472e78 | Tom Lane | 01 August 2010, 19:16:55 UTC | Fix an additional set of problems in GIN's handling of lossy page pointers. Although the key-combining code claimed to work correctly if its input contained both lossy and exact pointers for a single page in a single TID stream, in fact this did not work, and could not work without pretty fundamental redesign. Modify keyGetItem so that it will not return such a stream, by handling lossy-pointer cases a bit more explicitly than we did before. Per followup investigation of a gripe from Artur Dabrowski. An example of a query that failed given his data set is select count(*) from search_tab where (to_tsvector('german', keywords ) @@ to_tsquery('german', 'ee:* | dd:*')) and (to_tsvector('german', keywords ) @@ to_tsquery('german', 'aa:*')); Back-patch to 8.4 where the lossy pointer code was introduced. | 01 August 2010, 19:16:55 UTC |
4a8fcfd | Tom Lane | 31 July 2010, 03:27:57 UTC | Tweak tsmatchsel() so that it examines the structure of the tsquery whenever possible (ie, whenever the tsquery is a constant), even when no statistics are available for the tsvector. For example, foo @@ 'a & b'::tsquery can be expected to be more selective than foo @@ 'a'::tsquery, whether or not we know anything about foo. We use DEFAULT_TS_MATCH_SEL as the assumed selectivity of individual query terms when no stats are available, then combine the terms according to the query's AND/OR structure as usual. Per experimentation with Artur Dabrowski's example. (The fact that there are no stats available in that example is a problem in itself, but nonetheless tsmatchsel should be smarter about the case.) Back-patch to 8.4 to keep all versions of tsmatchsel() in sync. | 31 July 2010, 03:27:57 UTC |
8d3487d | Tom Lane | 31 July 2010, 00:31:12 UTC | Rewrite the key-combination logic in GIN's keyGetItem() and scanGetItem() routines to make them behave better in the presence of "lossy" index pointers. The previous coding was outright incorrect for some cases, as recently reported by Artur Dabrowski: scanGetItem would fail to return index entries in cases where one index key had multiple exact pointers on the same page as another key had a lossy pointer. Also, keyGetItem was extremely inefficient for cases where a single index key generates multiple "entry" streams, such as an @@ operator with a multiple-clause tsquery. The presence of a lossy page pointer in any one stream defeated its ability to use the opclass consistentFn, resulting in probing many heap pages that didn't really need to be visited. In Artur's example case, a query like WHERE tsvector @@ to_tsquery('a & b') was about 50X slower than the theoretically equivalent WHERE tsvector @@ to_tsquery('a') AND tsvector @@ to_tsquery('b') The way that I chose to fix this was to have GIN call the consistentFn twice with both TRUE and FALSE values for the in-doubt entry stream, returning a hit if either call produces TRUE, but not if they both return FALSE. The code handles this for the case of a single in-doubt entry stream, but punts (falling back to the stupid behavior) if there's more than one lossy reference to the same page. The idea could be scaled up to deal with multiple lossy references, but I think that would probably be wasted complexity. At least to judge by Artur's example, such cases don't occur often enough to be worth trying to optimize. Back-patch to 8.4. 8.3 did not have lossy GIN index pointers, so not subject to these problems. | 31 July 2010, 00:31:12 UTC |
6b8494a | Tom Lane | 30 July 2010, 17:56:59 UTC | Improved version of patch to protect pg_get_expr() against misuse: look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. Completion of back-port of my patch of yesterday. | 30 July 2010, 17:56:59 UTC |
b08fd11 | Tom Lane | 29 July 2010, 19:23:37 UTC | Fix another longstanding problem in copy_relation_data: it was blithely assuming that a local char[] array would be aligned on at least a word boundary. There are architectures on which that is pretty much guaranteed to NOT be the case ... and those arches also don't like non-aligned memory accesses, meaning that log_newpage() would crash if it ever got invoked. Even on Intel-ish machines there's a potential for a large performance penalty from doing I/O to an inadequately aligned buffer. So palloc it instead. Backpatch to 8.0 --- 7.4 doesn't have this code. | 29 July 2010, 19:23:37 UTC |
2d83461 | Robert Haas | 29 July 2010, 16:14:55 UTC | Fix possible page corruption by ALTER TABLE .. SET TABLESPACE. If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE will set the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage() will do the same thing during replay, so the corruption propagates to any standby. Note, however, that the bug can't be demonstrated unless archiving is enabled, since in that case we skip WAL logging altogether, and the LSN/TLI are not set. Back-patch to 8.0; prior releases do not have tablespaces. Analysis and patch by Jeff Davis. Adjustments for back-branches and minor wordsmithing by me. | 29 July 2010, 16:14:55 UTC |
5a188dc | Tom Lane | 28 July 2010, 04:51:08 UTC | Fix potential failure when hashing the output of a subplan that produces a pass-by-reference datatype with a nontrivial projection step. We were using the same memory context for the projection operation as for the temporary context used by the hashtable routines in execGrouping.c. However, the hashtable routines feel free to reset their temp context at any time, which'd lead to destroying input data that was still needed. Report and diagnosis by Tao Ma. Back-patch to 8.1, where the problem was introduced by the changes that allowed us to work with "virtual" tuples instead of materializing intermediate tuple values everywhere. The earlier code looks quite similar, but it doesn't suffer the problem because the data gets copied into another context as a result of having to materialize ExecProject's output tuple. | 28 July 2010, 04:51:08 UTC |
29789a8 | Robert Haas | 27 July 2010, 20:02:27 UTC | Fix typo in PL/pgsql code example. Backpatch to 8.4. Marc Cousin. Review by Kevin Grittner. | 27 July 2010, 20:02:27 UTC |