aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Remove broken Assertions that failed if a statement executed in PL/pgSQL isHeikki Linnakangas2009-01-14
| | | | | | | | | | rewritten into another kind of statement, for example if an INSERT is rewritten into an UPDATE. Back-patch to 8.3 and 8.2. For HEAD, Tom suggested inventing a new SPI_OK_REWRITTEN return code, but that's not a backportable solution. I'll do that as a separate patch, this patch will do as a stopgap measure for HEAD too in the meanwhile.
* Throw an error when using -C and -1 at the same time in pg_restore.Magnus Hagander2009-01-13
| | | | | | | It's not possible to do CREATE DATABASE inside a transaction, so previously we just got a server error instead. Backpatch to 8.2, which is where the -1 feature appeared.
* Update release notes for 8.3.5, 8.2.11, and 8.1.15 to mention the needBruce Momjian2009-01-09
| | | | | | | to reindex GiST indexes: If you were running a previous 8.X.X release, REINDEX all GiST indexes after the upgrade.
* Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,Tom Lane2009-01-07
| | | | | | | | | | | | | | | | | | | | OutputFunctionCall, and friends. This allows SPI-using functions to invoke datatype I/O without concern for the possibility that a SPI-using function will be called (which could be either the I/O function itself, or a function used in a domain check constraint). It's a tad ugly, but not nearly as ugly as what'd be needed to make this work via retail insertion of push/pop operations in all the PLs. This reverts my patch of 2007-01-30 that inserted some retail SPI_push/pop calls into plpgsql; that approach only fixed plpgsql, and not any other PLs. But the other PLs have the issue too, as illustrated by a recent gripe from Christian Schröder. Back-patch to 8.2, which is as far back as this solution will work. It's also as far back as we need to worry about the domain-constraint case, since earlier versions did not attempt to check domain constraints within datatype input. I'm not aware of any old I/O functions that use SPI themselves, so this should be sufficient for a back-patch.
* Remove references to pgsql-ports and pgsql-patches mailing lists fromTom Lane2009-01-06
| | | | | various documentation, since those lists are now dead/deprecated. Point to pgsql-bugs and/or pgsql-hackers as appropriate.
* Fix logic in lazy vacuum to decide if it's worth trying to truncate the heap.Heikki Linnakangas2009-01-06
| | | | | | | | If the table was smaller than REL_TRUNCATE_FRACTION (= 16) pages, we always tried to acquire AccessExclusiveLock on it even if there was no empty pages at the end. Report by Simon Riggs. Back-patch all the way to 7.4.
* Fix bug per Oleksiy Shchukin - 2nd argument for dblink_get_result(text,bool)Joe Conway2009-01-03
| | | | | | | is PG_GETARG_BOOL(2), should be PG_GETARG_BOOL(1). Apply simple fix to back branches only. More extensive change to be applied to head per Tom's suggestion.
* Make heap_update() set newtup->t_tableOid correctly, for consistency withTom Lane2008-12-16
| | | | | | | | | | the other major heapam.c functions. The only known consequence of this omission is that UPDATE RETURNING failed to return the correct value for "tableoid", as per report from KaiGai Kohei. Back-patch to 8.2. Arguably it's wrong all the way back; but without evidence of visible breakage before RETURNING was added, I'll desist from patching the older branches.
* Fix failure to ensure that a snapshot is available to datatype input functionsTom Lane2008-12-13
| | | | | | | | | | | | | | | | | | | when they are invoked by the parser. We had been setting up a snapshot at plan time but really it needs to be done earlier, before parse analysis. Per report from Dmitry Koterov. Also fix two related problems discovered while poking at this one: exec_bind_message called datatype input functions without establishing a snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without establishing a snapshot. Backpatch to 8.2. The underlying problem goes much further back, but it is masked in 8.1 and before because we didn't attempt to invoke domain check constraints within datatype input. It would only be exposed if a C-language datatype input function used the snapshot; which evidently none do, or we'd have heard complaints sooner. Since this code has changed a lot over time, a back-patch is hardly risk-free, and so I'm disinclined to patch further than absolutely necessary.
* Fix an oversight in the code that makes transitive-equality deductions fromTom Lane2008-12-01
| | | | | | | | | | | | | | | | | | | | outer join clauses. Given, say, ... from a left join b on a.a1 = b.b1 where a.a1 = 42; we'll deduce a clause b.b1 = 42 and then mark the original join clause redundant (we can't remove it completely for reasons I don't feel like squeezing into this log entry). However the original implementation of that wasn't bulletproof, because clause_selectivity() wouldn't honor this_selec if given nonzero varRelid --- which in practice meant that it worked as desired *except* when considering index scan quals. Which resulted in bogus underestimation of the size of the indexscan result for an inner indexscan in an outer join, and consequently a possibly bad choice of indexscan vs. bitmap scan. Fix by introducing an explicit test into clause_selectivity(). Also, to make sure we don't trigger that test in corner cases, change the convention to be that this_selec > 1, not this_selec = 1, means it's been marked redundant. Per trouble report from Scara Maccai. Back-patch to 8.2, where the problem was introduced.
* Ensure that the contents of a holdable cursor don't depend on out-of-lineTom Lane2008-12-01
| | | | | | | | | | | toasted values, since those could get dropped once the cursor's transaction is over. Per bug #4553 from Andrew Gierth. Back-patch as far as 8.1. The bug actually exists back to 7.4 when holdable cursors were introduced, but this patch won't work before 8.1 without significant adjustments. Given the lack of field complaints, it doesn't seem worth the work (and risk of introducing new bugs) to try to make a patch for the older branches.
* Fix dblink and tablefunc to not return with the wrong CurrentMemoryContext.Tom Lane2008-11-30
| | | | Per buildfarm results.
* Remove inappropriate memory context switch in shutdown_MultiFuncCall().Tom Lane2008-11-30
| | | | | | | This was a thinko introduced in a patch from last February; it results in memory leakage if an SRF is shut down before the actual end of query, because subsequent code will be running in a longer-lived context than it's expecting to be.
* information_schema.key_column_usage.position_in_unique_constraint wasTom Lane2008-11-25
| | | | | misdocumented as not being implemented. In reality it has worked since the release of 8.2.
* In predtest.c, install a limit on the number of branches we will process inTom Lane2008-11-12
| | | | | | | | | | | | | | | | | AND, OR, or equivalent clauses: if there are too many (more than 100) just exit without proving anything. This ensures that we don't spend O(N^2) time trying (and most likely failing) to prove anything about very long IN lists and similar cases. Also, install a couple of CHECK_FOR_INTERRUPTS calls to ensure that a long proof attempt can be interrupted. Per gripe from Sergey Konoplev. Back-patch the whole patch to 8.2 and just the CHECK_FOR_INTERRUPTS addition to 8.1. (The rest of the patch doesn't apply cleanly, and since 8.1 doesn't show the complained-of behavior anyway, it doesn't seem necessary to work hard on it.)
* Detect and error out on inability to get proper linkage information required ↵Andrew Dunstan2008-11-12
| | | | for plperl, usually due to absence of perl ExtUtils::Embed module. Backpatch as far as 8.1.
* Get rid of adjust_appendrel_attr_needed(), which has been broken ever sinceTom Lane2008-11-11
| | | | | | | | | | | we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead.
* Fix old bug in contrib/sslinfo: X509_NAME_to_text freed the BIO_s_mem bufferTom Lane2008-11-10
| | | | | | | | it was using too soon. In a situation where pg_do_encoding_conversion is a no-op, this led to garbage data returned. In HEAD, also modify the code that's ensuring null termination to make it a tad more obvious what's happening.
* tag 8.2.11REL8_2_11Marc G. Fournier2008-10-31
|
* Update back-branch release notes.Tom Lane2008-10-30
|
* Translation updatesPeter Eisentraut2008-10-30
|
* Update time zone data files to tzdata release 2008i (DST law changes inTom Lane2008-10-30
| | | | Argentina, Brazil, Mauritius, Syria).
* Missing space in error messagePeter Eisentraut2008-10-30
|
* Install a more robust solution for the problem of infinite error-processingTom Lane2008-10-27
| | | | | | | | | | | | | recursion when we are unable to convert a localized error message to the client's encoding. We've been over this ground before, but as reported by Ibrar Ahmed, it still didn't work in the case of conversion failures for the conversion-failure message itself :-(. Fix by installing a "circuit breaker" that disables attempts to localize this message once we get into recursion trouble. Patch all supported branches, because it is in fact broken in all of them; though I had to add some missing translations to the older branches in order to expose the failure in the particular test case I was using.
* Better solution to the IN-list issue: instead of having an arbitrary cutoff,Tom Lane2008-10-26
| | | | | | | treat Var and non-Var IN-list items differently. Only non-Var items are candidates to go into an ANY(ARRAY) construct --- we put all Vars as separate OR conditions on the grounds that that leaves more scope for optimization. Per suggestion from Robert Haas.
* Add a heuristic to transformAExprIn() to make it prefer expanding "x IN (list)"Tom Lane2008-10-25
| | | | | | | | | | | | | into an OR of equality comparisons, rather than x = ANY(ARRAY[...]), when there are Vars in the right-hand side. This avoids a performance regression compared to pre-8.2 releases, in cases where the OR form can be optimized into scans of multiple indexes. Limit the possible downside by preferring this form only when the list isn't very long (I set the cutoff at 32 elements, which is a bit arbitrary but in the right ballpark). Per discussion with Jim Nasby. In passing, also make it try the OR form if it cannot select a common type for the array elements; we've seen a complaint or two about how the OR form worked for such cases and ARRAY doesn't.
* Fix an old bug in after-trigger handling: AfterTriggerEndQuery took theTom Lane2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | address of afterTriggers->query_stack[afterTriggers->query_depth] and hung onto it through all its firings of triggers. However, if a trigger causes sufficiently many nested query executions, query_stack will get repalloc'd bigger, leaving AfterTriggerEndQuery --- and hence afterTriggerInvokeEvents --- using a stale pointer. So far as I can find, the only consequence of this error is to stomp on a couple of words of already-freed memory; which would lead to a failure only if that chunk had already gotten re-allocated for something else. So it's hard to exhibit a simple failure case, but this is surely a bug. I noticed this while working on my recent patch to reduce pending-trigger space usage. The present patch is mighty ugly, because it requires making afterTriggerInvokeEvents know about all the possible event lists it might get called on. Fortunately, this is only needed in back branches because CVS HEAD avoids the problem in a different way: afterTriggerInvokeEvents only touches the passed AfterTriggerEventList pointer once at startup. Back branches are stable enough that wiring in knowledge of all possible call usages doesn't seem like a killer problem. Back-patch to 8.0. 7.4's trigger code is completely different and doesn't seem to have the problem (it doesn't even use repalloc).
* Fix GiST's killing tuple: GISTScanOpaque->curpos wasn'tTeodor Sigaev2008-10-22
| | | | | | correctly set. As result, killtuple() marks as dead wrong tuple on page. Bug was introduced by me while fixing possible duplicates during GiST index scan.
* Fix small bug in headline generation.Teodor Sigaev2008-10-17
| | | | | Patch from Sushant Sinha <sushant354@gmail.com> http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
* Fix a small memory leak in ExecReScanAgg() in the hashed aggregation case.Neil Conway2008-10-16
| | | | | | | In the previous coding, the list of columns that needed to be hashed on was allocated in the per-query context, but we reallocated every time the Agg node was rescanned. Since this information doesn't change over a rescan, just construct the list of columns once during ExecInitAgg().
* Fix SPI_getvalue and SPI_getbinval to range-check the given attribute numberTom Lane2008-10-16
| | | | | | | | | | | | | | according to the TupleDesc's natts, not the number of physical columns in the tuple. The previous coding would do the wrong thing in cases where natts is different from the tuple's column count: either incorrectly report error when it should just treat the column as null, or actually crash due to indexing off the end of the TupleDesc's attribute array. (The second case is probably not possible in modern PG versions, due to more careful handling of inheritance cases than we once had. But it's still a clear lack of robustness here.) The incorrect error indication is ignored by all callers within the core PG distribution, so this bug has no symptoms visible within the core code, but it might well be an issue for add-on packages. So patch all the way back.
* Fix COPY documentation to not imply that HEADER can be used outside CSV mode.Tom Lane2008-10-10
| | | | Per gripe from Bill Thoen.
* Optional arguments should be optional.Michael Meskes2008-10-10
|
* Fix overly tense optimization of PLpgSQL_func_hashkey: we must representTom Lane2008-10-09
| | | | | | | | | | | | | | | the isTrigger state explicitly, not rely on nonzero-ness of trigrelOid to indicate trigger-hood, because trigrelOid will be left zero when compiling for validation. The (useless) function hash entry built by the validator was able to match an ordinary non-trigger call later in the same session, thereby bypassing the check that is supposed to prevent such a call. Per report from Alvaro. It might be worth suppressing the useless hash entry altogether, but that's a bigger change than I want to consider back-patching. Back-patch to 8.0. 7.4 doesn't have the problem because it doesn't have validation mode.
* When a relation is moved to another tablespace, we can't assume that we canHeikki Linnakangas2008-10-07
| | | | | | | | | | | | | | | | | use the old relfilenode in the new tablespace. There might be another relation in the new tablespace with the same relfilenode, so we must generate a fresh relfilenode in the new tablespace. The 8.3 patch to let deleted relation files linger as zero-length files until the next checkpoint made this more obvious: moving a relation from one table space another, and then back again, caused a collision with the lingering file. Back-patch to 8.1. The issue is present in 8.0 as well, but it doesn't seem worth fixing there, because we didn't have protection from OID collisions after OID wraparound before 8.1. Report by Guillaume Lelarge.
* Fix improper display of fractional seconds in interval valuesTom Lane2008-10-02
| | | | | | when using --enable-integer-datetimes and a non-ISO datestyle. Ron Mayer
* Recent patches to pg_ctl broke "pg_ctl restart" for the case where noTom Lane2008-09-30
| | | | | command-line options had been given to the postmaster; and just plain broke it altogether in 8.1 and 8.0. Per report from KaiGai Kohei.
* Fix more problems with rewriter failing to set Query.hasSubLinks when insertingTom Lane2008-09-24
| | | | | | | | | | a SubLink expression into a rule query. We missed cases where the original query contained a sub-SELECT in a function in FROM, a multi-row VALUES list, or a RETURNING list. Per bug #4434 from Dean Rasheed and subsequent investigation. Back-patch to 8.1; older releases don't have the issue because they didn't try to be smart about setting hasSubLinks only when needed.
* Make sure pg_control is opened in binary mode, to dealMagnus Hagander2008-09-24
| | | | | | | with situtations when the file contains an EOF maker (0x1A) on Windows. ITAGAKI Takahiro
* tag for 8.2.10REL8_2_10Marc G. Fournier2008-09-19
|
* Update back-branch release notes.Tom Lane2008-09-19
|
* Update time zone data files to tzdata release 2008f (DST law changes inTom Lane2008-09-17
| | | | Argentina, Bahamas, Brazil, Mauritius, Morocco, Pakistan, Palestine, Paraguay).
* Widen the nLocks counts in local lock tables from int to int64. ThisTom Lane2008-09-16
| | | | | | | | | | | | | forestalls potential overflow when the same table (or other object, but usually tables) is accessed by very many successive queries within a single transaction. Per report from Michael Milligan. Back-patch to 8.0, which is as far back as the patch conveniently applies. There have been no reports of overflow in pre-8.3 releases, but clearly the risk existed all along. (Michael's report suggests that 8.3 may consume lock counts faster than prior releases, but with no test case to look at it's hard to be sure about that. Widening the counts seems a good future-proofing measure in any event.)
* Initialize the minimum frozen Xid in vac_update_datfrozenxid usingAlvaro Herrera2008-09-11
| | | | | | | | | | | | | | | | | | | | GetOldestXmin() instead of RecentGlobalXmin; this is safer because we do not depend on the latter being correctly set elsewhere, and while it is more expensive, this code path is not performance-critical. This is a real risk for autovacuum, because it can execute whole cycles without doing a single vacuum, which would mean that RecentGlobalXmin would stay at its initialization value, FirstNormalTransactionId, causing a bogus value to be inserted in pg_database. This bug could explain some recent reports of failure to truncate pg_clog. At the same time, change the initialization of RecentGlobalXmin to InvalidTransactionId, and ensure that it's set to something else whenever it's going to be used. Using it as FirstNormalTransactionId in HOT page pruning could incur in data loss. InitPostgres takes care of setting it to a valid value, but the extra checks are there to prevent "special" backends from behaving in unusual ways. Per Tom Lane's detailed problem dissection in 29544.1221061979@sss.pgh.pa.us
* Fix plpgsql's exec_move_row() to supply valid type OIDs to exec_assign_value()Tom Lane2008-09-01
| | | | | | | | | | whenever possible, as per bug report from Oleg Serov. While at it, reorder the operations in the RECORD case to avoid possible palloc failure while the variable update is only partly complete. Back-patch as far as 8.1. Although the code of the particular function is similar in 8.0, 8.0's support for composite fields in rows is sufficiently broken elsewhere that it doesn't seem worth fixing this.
* Fix pg_dump docs to acknowledge that you can use -Z with plain text output. ↵Tom Lane2008-08-26
| | | | Pointed out by Daniel Migowski.
* Fix possible duplicate tuples while GiST scan. Now page is processedTeodor Sigaev2008-08-23
| | | | | | | | | at once and ItemPointers are collected in memory. Remove tuple's killing by killtuple() if tuple was moved to another page - it could produce unaceptable overhead. Backpatch up to 8.1 because the bug was introduced by GiST's concurrency support.
* Make libpq on windows not try to send chunks larger than 64Kb.Magnus Hagander2008-08-20
| | | | | | | | | Per Microsoft knowledge base article Q201213, early versions of Windows fail when we do this. Later versions of Windows appear to have a higher limit than 64Kb, but do still fail on large sends, so we unconditionally limit it for all versions. Patch from Tom Lane.
* Fix pg_dump/pg_restore's ExecuteSqlCommand() to behave suitably if PQexecTom Lane2008-08-16
| | | | | | | returns NULL instead of a PGresult. The former coding would fail, which is OK, but it neglected to give you the PQerrorMessage that might tell you why. In the oldest branches, there was another problem: it'd sometimes report PQerrorMessage from the wrong connection.
* Fix pull_up_simple_union_all to copy all rtable entries from child subquery toHeikki Linnakangas2008-08-14
| | | | | | | parent, not only those with RangeTblRefs. We need them in ExecCheckRTPerms. Report by Brendan O'Shea. Back-patch to 8.2, where pull_up_simple_union_all was introduced.