aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Tag 8.4.8.REL8_4_8Marc G. Fournier2011-04-15
|
* Translation updatesPeter Eisentraut2011-04-14
|
* Ensure mark_dummy_rel doesn't create dangling pointers in RelOptInfos.Tom Lane2011-04-13
| | | | | | | | | | | | | | | When we are doing GEQO join planning, the current memory context is a short-lived context that will be reset at the end of geqo_eval(). However, the RelOptInfos for base relations are set up before that and then re-used across many GEQO cycles. Hence, any code that modifies a baserel during join planning has to be careful not to put pointers to the short-lived context into the baserel struct. mark_dummy_rel got this wrong, leading to easy-to-reproduce-once-you-know-how crashes in 8.4, as reported off-list by Leo Carson of SDSC. Some improvements made in 9.0 make it difficult to demonstrate the crash in 9.0 or HEAD; but there's no doubt that there's still a risk factor here, so patch all branches that have the function. (Note: 8.3 has a similar function, but it's only applied to joinrels and thus is not a hazard.)
* Update time zone data files to tzdata release 2011f.Tom Lane2011-04-13
| | | | | DST law changes in Chile, Cuba, Falkland Islands, Morocco, Samoa, Turkey. Historical corrections for South Australia, Alaska, Hawaii.
* On IA64 architecture, we check the depth of the register stack in additionHeikki Linnakangas2011-04-13
| | | | | to the regular stack. The code to do that is platform and compiler specific, add support for the HP-UX native compiler.
* Fix broken pg_dump query.Tom Lane2011-04-13
| | | | | The 8.4 branch failed when talking to 7.0 servers. Per testing requested by Bruce.
* Be more wary of missing statistics in eqjoinsel_semi().Tom Lane2011-04-12
| | | | | | | | In particular, if we don't have real ndistinct estimates for both sides, fall back to assuming that half of the left-hand rows have join partners. This is what was done in 8.2 and 8.3 (cf nulltestsel() in those versions). It's pretty stupid but it won't lead us to think that an antijoin produces no rows out, as seen in recent example from Uwe Schroeder.
* Have pg_upgrade properly preserve relfrozenxid in toast tables.Bruce Momjian2011-04-08
| | | | | This fixes a pg_upgrade bug that could lead to query errors when clog files are improperly removed.
* Avoid use of mixed slash style paths in arguments to xcopy in MSVC builds.Andrew Dunstan2011-04-07
| | | | | Some versions of xcopy, notably on Windows 7 don't like it. Backpatch to 8.3, where we first used xcopy.
* Modernize dlopen interface code for FreeBSD and OpenBSD.Tom Lane2011-04-07
| | | | | | | | | | Remove the hard-wired assumption that __mips__ (and only __mips__) lacks dlopen in FreeBSD and OpenBSD. This assumption is outdated at least for OpenBSD, as per report from an anonymous 9.1 tester. We can perfectly well use HAVE_DLOPEN instead to decide which code to use. Some other cosmetic adjustments to make freebsd.c, netbsd.c, and openbsd.c exactly alike.
* Fix plpgsql's issues with dropped columns in rowtypes in 8.4 branch.Tom Lane2011-04-07
| | | | | | | | | | | This is a back-patch of commit dcb2bda9b7042dbf43f876c94ebf35d951de10e9 of Aug 6 2009, which fixed assorted cases in which plpgsql would fail to cope with composite types that contain any dropped columns. Per discussion, this fix has been out in 9.0 for long enough to make it improbable that it creates any new bugs, so this is a low-risk fix. To make it even lower risk, I did not back-patch the changes in execQual.c, but just accepted the duplication of code between there and tupconvert.c. The added files tupconvert.h and tupconvert.c match their current states in HEAD.
* Fix SortTocFromFile() to cope with lines that are too long for its buffer.Tom Lane2011-04-07
| | | | | | | | | | | The original coding supposed that a dump TOC file could never contain lines longer than 1K. The folly of that was exposed by a recent report from Per-Olov Esgard. We only really need to see the first dozen or two bytes of each line, since we're just trying to read off the numeric ID at the start of the line; so there's no need for a particularly huge buffer. What there is a need for is logic to not process continuation bufferloads. Back-patch to all supported branches, since it's always been like this.
* Prevent a rowtype from being included in itself.Tom Lane2011-03-28
| | | | | | | | | | | | | | | | Eventually we might be able to allow that, but it's not clear how many places need to be fixed to prevent infinite recursion when there's a direct or indirect inclusion of a rowtype in itself. One such place is CheckAttributeType(), which will recurse to stack overflow in cases such as those exhibited in bug #5950 from Alex Perepelica. If we were sure it was the only such place, we could easily modify the code added by this patch to stop the recursion without a complaint ... but it probably isn't the only such place. Hence, throw error until such time as someone is excited enough about this type of usage to put work into making it safe. Back-patch as far as 8.3. 8.2 doesn't have the recursive call in CheckAttributeType in the first place, so I see no need to add code there in the absence of clear evidence of a problem elsewhere.
* Avoid potential deadlock in InitCatCachePhase2().Tom Lane2011-03-22
| | | | | | | | | | | | | | | Opening a catcache's index could require reading from that cache's own catalog, which of course would acquire AccessShareLock on the catalog. So the original coding here risks locking index before heap, which could deadlock against another backend trying to get exclusive locks in the normal order. Because InitCatCachePhase2 is only called when a backend has to start up without a relcache init file, the deadlock was seldom seen in the field. (And by the same token, there's no need to worry about any performance disadvantage; so not much point in trying to distinguish exactly which catalogs have the risk.) Bug report, diagnosis, and patch by Nikhil Sontakke. Additional commentary by me. Back-patch to all supported branches.
* Fix PL/Python memory leak involving array slicesAlvaro Herrera2011-03-17
| | | | | Report and patch from Daniel Popowich, bug #5842 (with some debugging help from Alex Hunsaker)
* Use correct PATH separator for Cygwin in pg_regress.c.Andrew Dunstan2011-03-17
| | | | | | This has been broken for years, and I'm not sure why it has not been noticed before, but now a very modern Cygwin breaks on it, and the fix is clearly correct. Backpatching to all live branches.
* On further reflection, we'd better do the same in int.c.Tom Lane2011-03-11
| | | | | We previously heard of the same problem in int24div(), so there's not a good reason to suppose the problem is confined to cases involving int8.
* Put in some more safeguards against executing a division-by-zero.Tom Lane2011-03-11
| | | | | | | | Add dummy returns before every potential division-by-zero in int8.c, because apparently further "improvements" in gcc's optimizer have enabled it to break functions that weren't broken before. Aurelien Jarno, via Martin Pitt
* Don't throw a warning if vacuum sees PD_ALL_VISIBLE flag set on a page thatHeikki Linnakangas2011-03-08
| | | | | | | | | | | | | | | | | | | | contains newly-inserted tuples that according to our OldestXmin are not yet visible to everyone. The value returned by GetOldestXmin() is conservative, and it can move backwards on repeated calls, so if we see that contradiction between the PD_ALL_VISIBLE flag and status of tuples on the page, we have to assume it's because an earlier vacuum calculated a higher OldestXmin value, and all the tuples really are visible to everyone. We have received several reports of this bug, with the "PD_ALL_VISIBLE flag was incorrectly set in relation ..." warning appearing in logs. We were finally able to hunt it down with David Gould's help to run extra diagnostics in an environment where this happened frequently. Also reword the warning, per Robert Haas' suggestion, to not imply that the PD_ALL_VISIBLE flag is necessarily at fault, as it might also be a symptom of corruption on a tuple header. Backpatch to 8.4, where the PD_ALL_VISIBLE flag was introduced.
* Fix dangling-pointer problem in before-row update trigger processing.Tom Lane2011-02-21
| | | | | | | | | | | | | | | | | | | | | | ExecUpdate checked for whether ExecBRUpdateTriggers had returned a new tuple value by seeing if the returned tuple was pointer-equal to the old one. But the "old one" was in estate->es_junkFilter's result slot, which would be scribbled on if we had done an EvalPlanQual update in response to a concurrent update of the target tuple; therefore we were comparing a dangling pointer to a live one. Given the right set of circumstances we could get a false match, resulting in not forcing the tuple to be stored in the slot we thought it was stored in. In the case reported by Maxim Boguk in bug #5798, this led to "cannot extract system attribute from virtual tuple" failures when trying to do "RETURNING ctid". I believe there is a very-low-probability chance of more serious errors, such as generating incorrect index entries based on the original rather than the trigger-modified version of the row. In HEAD, change all of ExecBRInsertTriggers, ExecIRInsertTriggers, ExecBRUpdateTriggers, and ExecIRUpdateTriggers so that they continue to have similar APIs. In the back branches I just changed ExecBRUpdateTriggers, since there is no bug in the ExecBRInsertTriggers case.
* Fix tsmatchsel() to account properly for null rows.Tom Lane2011-02-17
| | | | | | | | | | | ts_typanalyze.c computes MCE statistics as fractions of the non-null rows, which seems fairly reasonable, and anyway changing it in released versions wouldn't be a good idea. But then ts_selfuncs.c has to account for that. Failure to do so results in overestimates in columns with a significant fraction of null documents. Back-patch to 8.4 where this stuff was introduced. Jesper Krogh
* Add CheckTableNotInUse calls in DROP TABLE and DROP INDEX.Tom Lane2011-02-15
| | | | | | | | | | | | | Recent releases had a check on rel->rd_refcnt in heap_drop_with_catalog, but failed to cover the possibility of pending trigger events at DROP time. (Before 8.4 we didn't even check the refcnt.) When the trigger events were eventually fired, you'd get "could not open relation with OID nnn" errors, as in recent report from strk. Better to throw a suitable error when the DROP is attempted. Also add a similar check in DROP INDEX. Back-patch to all supported branches.
* Undefine setlocale() macro on Win32Magnus Hagander2011-02-01
| | | | | | | | | New versions of libintl redefine setlocale() to a macro which causes problems when the backend and libintl are linked against different versions of the runtime, which is often the case in msvc builds. Hiroshi Inoue, slightly updated comment by me
* Fix wrong error reports in 'number of array dimensions exceeds theItagaki Takahiro2011-02-01
| | | | | | maximum allowed' messages, that have reported one-less dimensions. Alexey Klyukin
* Make reduce_outer_joins() smarter about semijoins.Tom Lane2011-01-30
| | | | | | | | | | | | | | reduce_outer_joins() mistakenly treated a semijoin like a left join for purposes of deciding whether not-null constraints created by the join's quals could be passed down into the join's left-hand side (possibly resulting in outer-join simplification there). Actually, semijoin works like inner join for this purpose, ie, we do not need to see any rows that can't possibly satisfy the quals. Hence, two-line fix to treat semi and inner joins alike. Per observation by Andres Freund about a performance gripe from Yazan Suleiman. Back-patch to 8.4, since this oversight has been there since the current handling of semijoins was implemented.
* Tag 8.4.7REL8_4_7Marc G. Fournier2011-01-27
|
* Don't include <asm/ia64regs.h> unnecessarily.Tom Lane2011-01-27
| | | | | | | We only need that header when compiling with icc, since the gcc variant of ia64_get_bsp() uses in-line assembly code. Per report from Frank Brendel, the header doesn't exist on all IA64 platforms; so don't include it unless we need it.
* Translation updates for release 8.4.7Peter Eisentraut2011-01-27
|
* Fix pg_restore to do the right thing when escaping large objects.Tom Lane2011-01-21
| | | | | | | | | | | | | | Specifically, this makes the workflow pg_dump -Fc -> pg_restore -> file produce correct output for BLOBs when the source database has standard_conforming_strings turned on. It was already okay when that was off, or if pg_restore was told to restore directly into a database. This is a back-port of commit b1732111f233bbb72788e92a627242ec28a85631 of 2009-08-04, with additional changes to emit old-style escaped bytea data instead of hex-style. At the time, we had not heard of anyone encountering the problem in the field, so I judged it not worth the risk of changing back branches. Now we do have a report, from Bosco Rama, so back-patch into 8.2 through 8.4. 9.0 and up are okay already.
* Fix miscalculation of itemsafter in array_set_slice().Tom Lane2011-01-17
| | | | | | | | | | | If the slice to be assigned to was before the existing array lower bound (requiring at least one null element to spring into existence to fill the gap), the code miscalculated how many entries needed to be copied from the old array's null bitmap. This could result in trashing the array's data area (as seen in bug #5840 from Karsten Loesing), or worse. This has been broken since we first allowed the behavior of assigning to non-adjacent slices, in 8.2. Back-patch to all affected versions.
* Ensure the directory for gram.h is created on win32Magnus Hagander2011-01-09
| | | | Result of bad testing of my last commit.
* Properly install gram.h on MSVC buildsMagnus Hagander2011-01-09
| | | | | This file is now needed by pgAdmin builds, which started failing since it was missing in the installer builds.
* Allow older branches to be built with Visual Studio 2008. This is a backport ↵Andrew Dunstan2011-01-04
| | | | of commit df0cdd53 to the 8.2, 8.3 and 8.4 branches.
* Work around header misdefines in modern Windows SDK when _WIN32_WINNT is ↵Andrew Dunstan2011-01-04
| | | | less than 0x0501. Only required for versions 8.2, 8.3 and 8.4., as we defined _WIN32_WINNT as 0x0501 after that.
* Avoid unexpected conversion overflow in planner for distant date values.Tom Lane2010-12-28
| | | | | | | | | | | | | | The "date" type supports a wider range of dates than int64 timestamps do. However, there is pre-int64-timestamp code in the planner that assumes that all date values can be converted to timestamp with impunity. Fortunately, what we really need out of the conversion is always a double (float8) value; so even when the date is out of timestamp's range it's possible to produce a sane answer. All we need is a code path that doesn't try to force the result into int64. Per trouble report from David Rericha. Back-patch to all supported versions. Although this is surely a corner case, there's not much point in advertising a date range wider than timestamp's if we will choke on such values in unexpected places.
* Allow vpath builds and regression tests to succeed on Mingw. Backpatch to ↵Andrew Dunstan2010-12-24
| | | | release 8.4 - earlier releases would require more changes and it's not worth the trouble.
* Fix up handling of simple-form CASE with constant test expression.Tom Lane2010-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | eval_const_expressions() can replace CaseTestExprs with constants when the surrounding CASE's test expression is a constant. This confuses ruleutils.c's heuristic for deparsing simple-form CASEs, leading to Assert failures or "unexpected CASE WHEN clause" errors. I had put in a hack solution for that years ago (see commit 514ce7a331c5bea8e55b106d624e55732a002295 of 2006-10-01), but bug #5794 from Peter Speck shows that that solution failed to cover all cases. Fortunately, there's a much better way, which came to me upon reflecting that Peter's "CASE TRUE WHEN" seemed pretty redundant: we can "simplify" the simple-form CASE to the general form of CASE, by simply omitting the constant test expression from the rebuilt CASE construct. This is intuitively valid because there is no need for the executor to evaluate the test expression at runtime; it will never be referenced, because any CaseTestExprs that would have referenced it are now replaced by constants. This won't save a whole lot of cycles, since evaluating a Const is pretty cheap, but a cycle saved is a cycle earned. In any case it beats kluging ruleutils.c still further. So this patch improves const-simplification and reverts the previous change in ruleutils.c. Back-patch to all supported branches. The bug exists in 8.1 too, but it's out of warranty.
* Fix erroneous parsing of tsquery input "... & !(subexpression) | ..."Tom Lane2010-12-19
| | | | | | | | | | | After parsing a parenthesized subexpression, we must pop all pending ANDs and NOTs off the stack, just like the case for a simple operand. Per bug #5793. Also fix clones of this routine in contrib/intarray and contrib/ltree, where input of types query_int and ltxtquery had the same problem. Back-patch to all supported versions.
* Remove optreset from src/port/ implementations of getopt and getopt_long.Tom Lane2010-12-16
| | | | | | | | | | We don't actually need optreset, because we can easily fix the code to ensure that it's cleanly restartable after having completed a scan over the argv array; which is the only case we need to restart in. Getting rid of it avoids a class of interactions with the system libraries and allows reversion of my change of yesterday in postmaster.c and postgres.c. Back-patch to 8.4. Before that the getopt code was a bit different anyway.
* Fix up getopt() reset management so it works on recent mingw.Tom Lane2010-12-15
| | | | | | | | | The mingw people don't appear to care about compatibility with non-GNU versions of getopt, so force use of our own copy of getopt on Windows. Also, ensure that we make use of optreset when using our own copy. Per report from Andrew Dunstan. Back-patch to all versions supported on Windows.
* Tag 8.4.6.REL8_4_6Marc G. Fournier2010-12-13
|
* Translation updates for release 8.4.6Peter Eisentraut2010-12-13
|
* Update time zone data files to tzdata release 2010o: DST law changes inTom Lane2010-12-13
| | | | Fiji and Samoa. Historical corrections for Hong Kong.
* Fix efficiency problems in tuplestore_trim().Tom Lane2010-12-10
| | | | | | | | | | | | | | | | | | | | | | 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.
* Force default wal_sync_method to be fdatasync on Linux.Tom Lane2010-12-08
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Add a stack overflow check to copyObject().Tom Lane2010-12-06
| | | | | | | | | | | | | | | 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.
* Prevent inlining a SQL function with multiple OUT parameters.Tom Lane2010-12-01
| | | | | | | | | | | | | 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.
* Fix leakage of cost_limit when multiple autovacuum workers are active.Tom Lane2010-11-19
| | | | | | | | | | | | | | | | 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.
* The GiST scan algorithm uses LSNs to detect concurrent pages splits, butHeikki Linnakangas2010-11-16
| | | | | | | | | | | | | 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.
* Fix aboriginal mistake in plpython's set-returning-function support.Tom Lane2010-11-15
| | | | | | | | | | 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.