aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* In a non-hashed Agg node, reset the "aggcontext" at group boundaries, insteadTom Lane2009-07-23
| | | | | | | | | | | of individually pfree'ing pass-by-reference transition values. This should be at least as fast as the prior coding, and it has the major advantage of clearing out any working data an aggregate function may have stored in or underneath the aggcontext. This avoids memory leakage when an aggregate such as array_agg() is used in GROUP BY mode. Per report from Chris Spotts. Back-patch to 8.4. In principle the problem could arise in prior versions, but since they didn't have array_agg the issue seems not critical.
* Fix another thinko in join_is_legal's handling of semijoins: we have to testTom Lane2009-07-23
| | | | | | | | | | | | | | | for the case that the semijoin was implemented within either input by unique-ifying its RHS before we test to see if it appears to match the current join situation. The previous coding would select semijoin logic in situations where we'd already unique-ified the RHS and joined it to some unrelated relation(s), and then came to join it to the semijoin's LHS. That still gave the right answer as far as the semijoin itself was concerned, but would lead to incorrectly examining only an arbitrary one of the matchable rows from the unrelated relation(s). The cause of this thinko was incorrect unification of the pre-8.4 logic for IN joins and OUTER joins --- the comparable case for outer joins can be handled after making the match test, but that's because there is nothing like the unique-ification escape hatch for outer joins. Per bug #4934 from Benjamin Reed.
* Fix mismatch in const:ness of parameters.Magnus Hagander2009-07-22
|
* Fix another semijoin-ordering bug. We already knew that we couldn'tTom Lane2009-07-21
| | | | | | | | | | | | | | | | | | reorder a semijoin into or out of the righthand side of another semijoin, but actually it doesn't work to reorder it into or out of the righthand side of a left or antijoin, either. Per bug #4906 from Mathieu Fenniak. This was sloppy thinking on my part. This identity does work: ( A left join B on (Pab) ) semijoin C on (Pac) == ( A semijoin C on (Pac) ) left join B on (Pab) but I failed to see that that doesn't mean this does: ( A left join B on (Pab) ) semijoin C on (Pbc) != A left join ( B semijoin C on (Pbc) ) on (Pab)
* Properly restore pg_largeobject.relfozenxid in binary upgrade mode.Bruce Momjian2009-07-20
| | | | Backpatch to 8.4.X.
* Install src/include/utils/fmgroids.h on VPATH builds too.Alvaro Herrera2009-07-20
| | | | | | The original coding was not dealing specially with this file being a symlink, with the end result that it was not installed in VPATH builds. Oddly enough, the clean target does know about it ...
* Remove unnecessary and version-sensitive dependence on the exact set ofTom Lane2009-07-20
| | | | column names to be found in a sequence. Per gripe from Bruce.
* Fix a thinko in join_is_legal: when we decide we can implement a semijoinTom Lane2009-07-19
| | | | | | | | | | | | | | | | by unique-ifying the RHS and then inner-joining to some other relation, that is not grounds for violating the RHS of some other outer join. Noticed while regression-testing new GEQO code, which will blindly follow any path that join_is_legal says is legal, and then complain later if that leads to a dead end. I'm not certain that this can result in any visible failure in 8.4: the mistake may always be masked by the fact that subsequent attempts to join the rest of the RHS of the other join will fail. But I'm not certain it can't, either, and it's definitely not operating as intended. So back-patch. The added regression test depends on the new no-failures-allowed logic that I'm about to commit in GEQO, so no point back-patching that.
* Fix error cleanup failure caused by 8.4 changes in plpgsql to try to avoidTom Lane2009-07-18
| | | | | | | | | | | | | | | | | | | memory leakage in error recovery. We were calling FreeExprContext, and therefore invoking ExprContextCallback callbacks, in both normal and error exits from subtransactions. However this isn't very safe, as shown in recent trouble report from Frank van Vugt, in which releasing a tupledesc refcount failed. It's also unnecessary, since the resources that callbacks might wish to release should be cleaned up by other error recovery mechanisms (ie the resource owners). We only really want FreeExprContext to release memory attached to the exprcontext in the error-exit case. So, add a bool parameter to FreeExprContext to tell it not to call the callbacks. A more general solution would be to pass the isCommit bool parameter on to the callbacks, so they could do only safe things during error exit. But that would make the patch significantly more invasive and possibly break third-party code that registers ExprContextCallback callbacks. We might want to do that later in HEAD, but for now I'll just do what seems reasonable to back-patch.
* Repair bug #4926 "too few pathkeys for mergeclauses". This example showsTom Lane2009-07-17
| | | | | | | | | that the sanity checking I added to create_mergejoin_plan() in 8.3 was a few bricks shy of a load: the mergeclauses could reference pathkeys in a noncanonical order such as x,y,x, not only cases like x,x,y which is all that the code had allowed for. The odd cases only turn up when using redundant clauses in an outer join condition, which is why no one had noticed before.
* Do a conditional SPI_push/SPI_pop when replanning a query inTom Lane2009-07-14
| | | | | | | | | | | | | RevalidateCachedPlan. This is to avoid a "SPI_ERROR_CONNECT" failure when the planner calls a SPI-using function and we are already inside one. The alternative fix is to expect callers of RevalidateCachedPlan to do this, which seems likely to result in additional hard-to-detect bugs of omission. Per reports from Frank van Vugt and Marek Lewczuk. Back-patch to 8.3. It's much harder to trigger the bug in 8.3, due to a smaller set of cases in which plans can be invalidated, but it could happen. (I think perhaps only a SI reset event could make 8.3 fail here, but that's certainly within the realm of possibility.)
* Fix set_rel_width() to do something reasonable with non-Var items in aTom Lane2009-07-11
| | | | | | | | | | | | | RelOptInfo targetlist. It used to be that the only possibility other than a Var was a RowExpr representing a whole-row child Var, but as of 8.4's expanded ability to flatten appendrel members, we can get arbitrary expressions in there. Use the expression's type info and get_typavgwidth() to produce an at-least-marginally-sane result. Note that get_typavgwidth()'s fallback estimate (32 bytes) is the same as what was here before, so there will be no behavioral change for RowExprs. Noted while looking at recent gripe about constant quals pushed down to FunctionScan appendrel members ... not only were we failing to recognize the constant qual, we were getting the width estimate wrong :-(
* Remove no-longer-necessary transmission of postmaster's LC_COLLATE andTom Lane2009-07-08
| | | | | | LC_CTYPE settings to children via BackendParameters. Per discussion, the postmaster is now just using system defaults anyway, so we might as well save a few cycles during backend startup.
* Need to use pg_perm_setlocale when setting LC_CTYPE and LC_COLLATE at startup.Heikki Linnakangas2009-07-08
| | | | | | | | Otherwise, the LC_CTYPE/COLLATE setting gets reverted when using plperl, which leads to incorrect query results and index corruption. This was accidentally broken in the per-database locale patch in 8.4. Pointed out by Andrew Gierth.
* Fix ancient bug in handling of to_char modifier 'TH', when used with HH.Heikki Linnakangas2009-07-06
| | | | | In what seems like an oversight, we used to treat 'TH' the same as lowercase 'th', but only with HH/HH12.
* Fix set_append_rel_pathlist() to deal intelligently with cases whereTom Lane2009-07-06
| | | | | | | | | | | substituting a child rel's output expressions into the appendrel's restriction clauses yields a pseudoconstant restriction. We might be able to skip scanning that child rel entirely (if we get constant FALSE), or generate a one-time filter. 8.3 more or less accidentally generated plans that weren't completely stupid in these cases, but that was only because an extra recursive level of subquery_planner() always occurred and allowed const-simplification to happen. 8.4's ability to pull up appendrel members with non-Var outputs exposes the fact that we need to work harder here. Per gripe from Sergey Burladyan.
* Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allowTom Lane2009-07-06
| | | | | | | parentheses around the <query expression body> that follows a WITH clause, eg with cte(foo) as ( values(0) ) ((select foo from cte)); This seems to be just an oversight/thinko in gram.y. Noted while experimenting with bug #4902.
* Fix handling of changed-Param signaling for CteScan plan nodes. We were usingTom Lane2009-07-06
| | | | | | | | | | the "cteParam" as a proxy for the possibility that the underlying CTE plan depends on outer-level variables or Params, but that doesn't work very well because it sometimes causes calling subqueries to be treated as SubPlans when they could be InitPlans. This is inefficient and also causes the outright failure exhibited in bug #4902. Instead, leave the cteParam out of it and copy the underlying CTE plan's extParams directly. Per bug #4902 from Marko Tiikkaja.
* Fix up pg_dump's --binary-upgrade option so that it behaves properly withTom Lane2009-07-02
| | | | inherited columns and check constraints. Per my recent trouble report.
* Add missed src/include/foreign subdirectory to the set installed intoTom Lane2009-07-01
| | | | INSTALLDIR/include/server/. Itagaki Takahiro
* Bundle v8.4.0Marc G. Fournier2009-06-27
|
* Cleanup and code review for the patch that made bgwriter active duringTom Lane2009-06-26
| | | | | | | | | | | | | archive recovery. Invent a separate state variable and inquiry function for XLogInsertAllowed() to clarify some tests and make the management of writing the end-of-recovery checkpoint less klugy. Fix several places that were incorrectly testing InRecovery when they should be looking at RecoveryInProgress or XLogInsertAllowed (because they will now be executed in the bgwriter not startup process). Clarify handling of bad LSNs passed to XLogFlush during recovery. Use a spinlock for setting/testing SharedRecoveryInProgress. Improve quite a lot of comments. Heikki and Tom
* Translation updates for 8.4 release.Peter Eisentraut2009-06-26
| | | | | File that are translated less than 80% have been removed, as per new translation team policy.
* Add __attribute__((format_arg(1))) to the declaration of err_gettext(),Tom Lane2009-06-25
| | | | | to restore gcc's ability to crosscheck format arguments within elog.c. Noted in a test compilation with -Wformat-nonliteral enabled.
* Fix some serious bugs in archive recovery, now that bgwriter is activeHeikki Linnakangas2009-06-25
| | | | | | | | | | | | | | | | | | | | during it: When bgwriter is active, the startup process can't perform mdsync() correctly because it won't see the fsync requests accumulated in bgwriter's private pendingOpsTable. Therefore make bgwriter responsible for the end-of-recovery checkpoint as well, when it's active. When bgwriter is active (= archive recovery), the startup process must not accumulate fsync requests to its own pendingOpsTable, since bgwriter won't see them there when it performs restartpoints. Make startup process drop its pendingOpsTable when bgwriter is launched to avoid that. Update minimum recovery point one last time when leaving archive recovery. It won't be updated by the end-of-recovery checkpoint because XLogFlush() sees us as out of recovery already. This fixes bug #4879 reported by Fujii Masao.
* The code to unlink dropped relations in FinishPreparedTransaction() wasHeikki Linnakangas2009-06-25
| | | | | | acting like runs inside WAL recovery, but it doesn't. I must've copy-pasted this from a redo-function in the relation forks patch. Noticed by Tom Lane while he was looking through callers of smgrdounlink().
* Disallow empty passwords in LDAP authentication, the same wayMagnus Hagander2009-06-25
| | | | we already do it for PAM.
* Correct grammar in picksplit debug messagesPeter Eisentraut2009-06-24
|
* parse_ident_usermap() shuold use ereport(LOG) and not ERROR, and put theMagnus Hagander2009-06-24
| | | | | | return value in the *error_p variable. Noted by Tom.
* Properly initialize SSL engines when used from libpq. This is required forMagnus Hagander2009-06-23
| | | | | | most external engines. Per report and initial code from Lars Kanis
* Fix an ancient error in dist_ps (distance from point to line segment), whichTom Lane2009-06-23
| | | | | | | | | | | | a number of other geometric operators also depend on. It miscalculated the slope of the perpendicular to the given line segment anytime that slope was other than 0, infinite, or +/-1. In some cases the error would be masked because the true closest point on the line segment was one of its endpoints rather than the intersection point, but in other cases it could give an arbitrarily bad answer. Per bug #4872 from Nick Roosevelt. Bug goes clear back to Berkeley days, so patch all supported branches. Make a couple of cosmetic adjustments while at it.
* Fix the makefiles to fail cleanly if Perl is needed but not present. ThisTom Lane2009-06-23
| | | | | | | | | | used to work as intended, but got broken some time ago (a quoted empty string is not an empty string), and got broken some more by the changes to generate ecpg's preproc.y automatically. Given all the unprotected uses of $(PERL) elsewhere, it seems best to make use of the $(missing) script rather than trying to ensure each such use is protected individually. Also fix various bits of documentation that omitted to mention Perl as a requirement for building from a CVS pull. Per a complaint from Robert Haas.
* bundle RC2REL8_4_RC2Marc G. Fournier2009-06-22
|
* For bulk write operations (eg COPY IN), use a ring buffer of 16MB insteadTom Lane2009-06-22
| | | | | | | | of the 256KB limit originally enforced by a patch committed 2008-11-06. Per recent test results, the smaller size resulted in an undesirable decrease in bulk data loading speed, due to COPY processing frequently getting blocked for WAL flushing. This area might need more tweaking later, but this setting seems to be good enough for 8.4.
* Make to_timestamp and friends skip leading spaces before an integer field,Tom Lane2009-06-22
| | | | | | | | | | | | | even when not in FM mode. This improves compatibility with Oracle and with our pre-8.4 behavior, as per bug #4862. Brendan Jurd Add a couple of regression test cases for this. In passing, get rid of the labeling of the individual test cases; doesn't seem to be good for anything except causing extra work when inserting a test... Tom Lane
* Revert dubious message wording change.Tom Lane2009-06-22
|
* Message fixesPeter Eisentraut2009-06-21
|
* Fix things so that array_agg_finalfn does not modify or free its inputTom Lane2009-06-20
| | | | | | | ArrayBuildState, per trouble report from Merlin Moncure. By adopting this fix, we are essentially deciding that aggregate final-functions should not modify their inputs ever. Adjust documentation and comments to match that conclusion.
* Refine the use of terminology around bound and unbound cursors and cursorPeter Eisentraut2009-06-18
| | | | variables. Remove the confusing term "reference cursor".
* Fix a few errors in comments. Patch by Fujii Masao, plus the one inHeikki Linnakangas2009-06-18
| | | | visibilitymap.c by me.
* Fix the just-reported problem that you can't specify all four trigger eventTom Lane2009-06-18
| | | | | | types in CREATE TRIGGER. While at it, clean up the amazingly tedious and inextensible way that the trigger event type list was handled. Per report from Greg Sabino Mullane.
* ExecAgg() failed to finish running out set-returning functions in the lastTom Lane2009-06-17
| | | | | | aggregated tuple of a run. Per report from Laurenz Albe. This is a new bug in 8.4, but only because prior versions rejected SRFs in an Agg plan node altogether.
* Fix typo in error message: tgargv -> tg_argvPeter Eisentraut2009-06-17
|
* Change test tables in copy2 regression test to be temporary tables.Tom Lane2009-06-14
| | | | | | | | | This prevents autovacuum from reclaiming free space in them and causing the test's output row order to change, which is causing intermittent bogus failure reports in the buildfarm. Backpatch to 8.3. The issue exists further back, but since autovacuum was not on by default before 8.3, it's not a problem for buildfarm testing.
* Fix get_sort_group_operators() so that it doesn't think arrays can be groupedTom Lane2009-06-13
| | | | | via hashing. Eventually we ought to make that possible, but it won't happen for 8.4. Per yesterday's report from Robert Haas.
* Tweak the display of incoming foreign-key constraints in \d, per discussionPeter Eisentraut2009-06-13
| | | | | on hackers. Also, take that string out of the translation roster, since it's now entirely pseudo-SQL.
* Fix several places where a function was declared static and then definedTom Lane2009-06-12
| | | | without static. Per testing with a compiler that complains about this.
* time to tag rc1 ...REL8_4_RC1Marc G. Fournier2009-06-12
|
* Tighten typedef check for Linux.Bruce Momjian2009-06-12
|
* Mention BSD/OS find_typedef behavior.Bruce Momjian2009-06-12
|