Tom Lane [Sat, 2 May 2009 20:17:33 +0000 (20:17 +0000)]
Split the release notes into a separate file for each (active) major branch,
as per my recent proposal. release.sgml itself is now just a stub that should
change rarely; ideally, only once per major release to add a new include line.
Most editing work will occur in the release-N.N.sgml files. To update a back
branch for a minor release, just copy the appropriate release-N.N.sgml
file(s) into the back branch.
This commit doesn't change the end-product documentation at all, only the
source layout. However, it makes it easy to start omitting ancient information
from newer branches' documentation, should we ever decide to do that.
branch-fixup [Sat, 2 May 2009 20:17:19 +0000 (20:17 +0000)]
Add files from parent branch HEAD:
doc/src/sgml/generate_history.pl
doc/src/sgml/release-7.4.sgml
doc/src/sgml/release-8.0.sgml
doc/src/sgml/release-8.1.sgml
doc/src/sgml/release-8.2.sgml
doc/src/sgml/release-8.3.sgml
doc/src/sgml/release-old.sgml
Tom Lane [Fri, 1 May 2009 19:29:13 +0000 (19:29 +0000)]
When checking for datetime field overflow, we should allow a fractional-second
part that rounds up to exactly 1.0 second. The previous coding rejected input
like "00:12:57.
9999999999999999999999999999", with the exact number of nines
needed to cause failure varying depending on float-timestamp option and
possibly on platform. Obviously this should round up to the next integral
second, if we don't have enough precision to distinguish the value from that.
Per bug #4789 from Robert Kruus.
In passing, fix a missed check for fractional seconds in one copy of the
"is it greater than 24:00:00" code.
Broken all the way back, so patch all the way back.
Tom Lane [Sat, 25 Apr 2009 16:45:03 +0000 (16:45 +0000)]
Fix the handling of sub-SELECTs appearing in the arguments of an outer-level
aggregate function. By definition, such a sub-SELECT cannot reference any
variables of query levels between itself and the aggregate's semantic level
(else the aggregate would've been assigned to that lower level instead).
So the correct, most efficient implementation is to treat the sub-SELECT as
being a sub-select of that outer query level, not the level the aggregate
syntactically appears in. Not doing so also confuses the heck out of our
parameter-passing logic, as illustrated in bug report from Daniel Grace.
Fortunately, we were already copying the whole Aggref expression up to the
outer query level, so all that's needed is to delay SS_process_sublinks
processing of the sub-SELECT until control returns to the outer level.
This has been broken since we introduced spec-compliant treatment of
outer aggregates in 7.4; so patch all the way back.
Bruce Momjian [Sat, 25 Apr 2009 15:54:02 +0000 (15:54 +0000)]
Remove HELIOS Software GmbH name and copyright from AIX dynloader files,
per approval from Helmut Tschemernjak, President.
Only back branches; files removed from CVS HEAD.
Tom Lane [Sun, 19 Apr 2009 20:36:13 +0000 (20:36 +0000)]
Fix textsearch documentation examples to not recommend concatenating separate
fields without putting a space between. Per gripe from Rick Schumeyer.
Tom Lane [Thu, 16 Apr 2009 20:42:28 +0000 (20:42 +0000)]
Fix planner to restore its previous level of intelligence about pushing
constants through full joins, as in
select * from tenk1 a full join tenk1 b using (unique1)
where unique1 = 42;
which should generate a fairly cheap plan where we apply the constraint
unique1 = 42 in each relation scan. This had been broken by my patch of
2008-06-27, which is now reverted in favor of a more invasive but hopefully
less incorrect approach. That patch was meant to prevent incorrect extraction
of OR'd indexclauses from OR conditions above an outer join. To do that
correctly we need more information than the outerjoin_delay flag can provide,
so add a nullable_relids field to RestrictInfo that records exactly which
relations are nulled by outer joins that are underneath a particular qual
clause. A side benefit is that we can make the test in create_or_index_quals
more specific: it is now smart enough to extract an OR'd indexclause into the
outer side of an outer join, even though it must not do so in the inner side.
The old coding couldn't distinguish these cases so it could not do either.
Magnus Hagander [Wed, 15 Apr 2009 18:58:34 +0000 (18:58 +0000)]
Remove beer-ware license from crypt-md5.c, per
approval from Poul-Henning Kamp.
This makes the file the same standard 2-clause BSD as the
rest of PostgreSQL.
Tom Lane [Thu, 9 Apr 2009 20:50:51 +0000 (20:50 +0000)]
Update time zone data files to tzdata release 2009e: DST law changes in
Argentina/San_Luis, Cuba, Jordan (historical correction only), Morocco,
Palestine, Syria, Tunisia.
Tom Lane [Tue, 7 Apr 2009 18:10:56 +0000 (18:10 +0000)]
Fix contrib/pg_freespacemap's underestimate of the number of pages it
could find in the FSM. Per report from Dimitri Fontaine and Andrew Gierth.
(Affects only 8.2 and 8.3 since HEAD no longer has MaxFSMPages at all.)
Tom Lane [Tue, 7 Apr 2009 15:54:01 +0000 (15:54 +0000)]
Defend against non-ASCII letters in fuzzystrmatch code. The functions
still don't behave very sanely for multibyte encodings, but at least
they won't be indexing off the ends of static arrays.
Teodor Sigaev [Mon, 6 Apr 2009 14:39:25 +0000 (14:39 +0000)]
Fix 'all at one page bug' in picksplit method of R-tree emulation. Add defense
from buggy user-defined picksplit to GiST.
Tom Lane [Sat, 4 Apr 2009 04:53:34 +0000 (04:53 +0000)]
Rewrite interval_hash() so that the hashcodes are equal for values that
interval_eq() considers equal. I'm not sure how that fundamental requirement
escaped us through multiple revisions of this hash function, but there it is;
it's been wrong since interval_hash was first written for PG 7.1.
Per bug #4748 from Roman Kononov.
Backpatch to all supported releases.
This patch changes the contents of hash indexes for interval columns. That's
no particular problem for PG 8.4, since we've broken on-disk compatibility
of hash indexes already; but it will require a migration warning note in
the next minor releases of all existing branches: "if you have any hash
indexes on columns of type interval, REINDEX them after updating".
Tom Lane [Fri, 3 Apr 2009 23:27:22 +0000 (23:27 +0000)]
Use (unsigned char) cast in argument of pg_tolower(). Maybe it works on
Windows without that, but we shouldn't put bad examples where people might
copy them. Also, reformat slightly to improve the odds that pgindent
won't go nuts on this.
Magnus Hagander [Fri, 3 Apr 2009 11:52:12 +0000 (11:52 +0000)]
Make directory name comparisons on Win32 case insensitive.
This method will not catch all different ways since the locale
handling in NTFS doesn't provide an easy way to do that, but it
will hopefully solve the most common cases causing startup
problems when the backend is found in the system PATH.
Attempts to fix bug #4694.
Teodor Sigaev [Thu, 2 Apr 2009 17:57:59 +0000 (17:57 +0000)]
Fix memory allocation for output of hstore type.
Per "maosen.zhang" <
[email protected]> report.
Tom Lane [Thu, 2 Apr 2009 03:51:50 +0000 (03:51 +0000)]
Fix GUC's reports of assign_hook failure to always include the parameter value
we failed to assign, even in "can't happen" cases. Motivated by wondering
what's going on in a recent trouble report where "failed to commit" did
happen.
Tom Lane [Thu, 2 Apr 2009 01:16:17 +0000 (01:16 +0000)]
plpgsql's exec_simple_cast_value() mistakenly supposed that it could bypass
casting effort whenever the input value was NULL. However this prevents
application of not-null domain constraints in the cases that use this
function, as illustrated in bug #4741. Since this function isn't meant
for use in performance-critical paths anyway, this certainly seems like
another case of "premature optimization is the root of all evil".
Back-patch as far as 8.2; older versions made no effort to enforce
domain constraints here anyway.
Tom Lane [Wed, 1 Apr 2009 18:54:33 +0000 (18:54 +0000)]
Improve pg_dump's query for retrieving BLOB comments to be more efficient
when there are many blobs and not so many comments. Tamas Vincze
Tom Lane [Tue, 31 Mar 2009 22:54:52 +0000 (22:54 +0000)]
Fix contrib/pgstattuple and contrib/pageinspect to prevent attempts to read
temporary tables of other sessions; that is unsafe because of the way our
buffer management works. Per report from Stuart Bishop.
This is redundant with the bufmgr.c checks in HEAD, but not at all redundant
in the back branches.
Magnus Hagander [Tue, 31 Mar 2009 18:58:38 +0000 (18:58 +0000)]
Don't crash initdb when we fail to get the current username.
Give an error message and exit instead, like we do elsewhere...
Per report from Wez Furlong and Robert Treat.
Heikki Linnakangas [Tue, 31 Mar 2009 05:18:39 +0000 (05:18 +0000)]
Fix a rare race condition when commit_siblings > 0 and a transaction commits
at the same instant as a new backend is spawned. Since CountActiveBackends()
doesn't hold ProcArrayLock, it needs to be prepared for the case that a
pointer at the end of the proc array is still NULL even though numProcs says
it should be valid, since it doesn't hold ProcArrayLock. Backpatch to 8.1.
8.0 and earlier had this right, but it was broken in the split of PGPROC and
sinval shared memory arrays.
Per report and proposal by Marko Kreen.
Alvaro Herrera [Mon, 30 Mar 2009 16:16:13 +0000 (16:16 +0000)]
Update URL to Python bug tracker. Backpatch to 8.3; doesn't seem worthy of
further backpatch.
Tom Lane [Mon, 30 Mar 2009 04:09:09 +0000 (04:09 +0000)]
Fix an oversight in the support for storing/retrieving "minimal tuples" in
TupleTableSlots. We have functions for retrieving a minimal tuple from a slot
after storing a regular tuple in it, or vice versa; but these were implemented
by converting the internal storage from one format to the other. The problem
with that is it invalidates any pass-by-reference Datums that were already
fetched from the slot, since they'll be pointing into the just-freed version
of the tuple. The known problem cases involve fetching both a whole-row
variable and a pass-by-reference value from a slot that is fed from a
tuplestore or tuplesort object. The added regression tests illustrate some
simple cases, but there may be other failure scenarios traceable to the same
bug. Note that the added tests probably only fail on unpatched code if it's
built with --enable-cassert; otherwise the bug leads to fetching from freed
memory, which will not have been overwritten without additional conditions.
Fix by allowing a slot to contain both formats simultaneously; which turns out
not to complicate the logic much at all, if anything it seems less contorted
than before.
Back-patch to 8.2, where minimal tuples were introduced.
Heikki Linnakangas [Fri, 27 Mar 2009 14:58:54 +0000 (14:58 +0000)]
Fix tab completion of ANALYZE VERBOSE <tab>. It was previously confused
with EXPLAIN ANALYZE VERBOSE.
Greg Sabino Mullane, reformatted by myself. Backpatch to 8.1, where the
bug was introduced.
Tom Lane [Thu, 26 Mar 2009 22:29:20 +0000 (22:29 +0000)]
Make pg_standby's maxretries option do what one would expect. Fujii Masao
Tom Lane [Wed, 25 Mar 2009 15:03:19 +0000 (15:03 +0000)]
Fix old thinko in pgp.h: the idea is to declare some named enum types,
not global variables of anonymous enum types. This didn't actually hurt
much because most linkers will just merge the duplicated definitions ...
but some will complain. Per bug #4731 from Ceriel Jacobs.
Backpatch to 8.1 --- the declarations don't exist before that.
Tom Lane [Tue, 24 Mar 2009 22:06:24 +0000 (22:06 +0000)]
Install a search tree depth limit in GIN bulk-insert operations, to prevent
them from degrading badly when the input is sorted or nearly so. In this
scenario the tree is unbalanced to the point of becoming a mere linked list,
so insertions become O(N^2). The easiest and most safely back-patchable
solution is to stop growing the tree sooner, ie limit the growth of N. We
might later consider a rebalancing tree algorithm, but it's not clear that
the benefit would be worth the cost and complexity. Per report from Sergey
Burladyan and an earlier complaint from Heikki.
Back-patch to 8.2; older versions didn't have GIN indexes.
Heikki Linnakangas [Wed, 18 Mar 2009 20:30:36 +0000 (20:30 +0000)]
Don't set the signal handler for SIGQUIT on Windows. Buildfarm shows that
reinstalling the default signal handler doesn't work as it is on Windows.
Presumably core dumps on SIGQUIT are not a problem on Windows, so rather
than figure out what header files or other changes are required to make it
work, just don't bother.
Heikki Linnakangas [Wed, 18 Mar 2009 19:27:30 +0000 (19:27 +0000)]
Don't intercept SIGQUIT as a signal to trigger failover; that's what
postmaster uses for immediate shutdown. Trap SIGUSR1 as the preferred
signal for that.
Per report by Fujii Masao and subsequent discussion on -hackers.
Heikki Linnakangas [Wed, 18 Mar 2009 08:44:52 +0000 (08:44 +0000)]
Fix Windows-specific race condition in syslogger. This could've been
the cause of the "could not write to log file: Bad file descriptor"
errors reported at
http://archives.postgresql.org//pgsql-general/2008-06/msg00193.php
Backpatch to 8.3, the race condition was introduced by the CSV logging
patch.
Analysis and patch by Gurjeet Singh.
Tom Lane [Sun, 15 Mar 2009 22:05:25 +0000 (22:05 +0000)]
Fix contrib/hstore to throw an error for keys or values that don't fit in its
data structure, rather than silently truncating them. Andrew Gierth
Marc G. Fournier [Fri, 13 Mar 2009 02:08:41 +0000 (02:08 +0000)]
tag 8.3.7
Tom Lane [Thu, 12 Mar 2009 22:35:57 +0000 (22:35 +0000)]
Update back-branch release notes.
Peter Eisentraut [Thu, 12 Mar 2009 13:19:06 +0000 (13:19 +0000)]
Translation updates
Tom Lane [Thu, 12 Mar 2009 00:53:32 +0000 (00:53 +0000)]
Fix core dump due to null-pointer dereference in to_char() when datetime
format codes are misapplied to a numeric argument. (The code still produces
a pretty bogus error message in such cases, but I'll settle for stopping the
crash for now.) Per bug #4700 from Sergey Burladyan.
Problem exists in all supported branches, so patch all the way back.
In HEAD, also clean up some ugly coding in the nearby cache management
code.
Alvaro Herrera [Wed, 11 Mar 2009 00:08:07 +0000 (00:08 +0000)]
Remove pg_trace.h inclusion from c.h and add it to the .c files that need it.
Only needed in 8.3 because it's already this way in HEAD, and older branches
did not support DTrace. This allows external modules to compile on Linux
machines where SystemTap support was recently added, when the required
SystemTap headers are not present on the build machine.
Approach suggested by Tom, after a RPM build trouble report by Devrim Gunduz.
Tom Lane [Tue, 10 Mar 2009 20:58:41 +0000 (20:58 +0000)]
Fix set_subquery_pathlist() to copy the RTE's subquery before it gets mangled
by the planning process. This prevents the "failed to locate grouping columns"
error recently reported by Dickson Guedes. That happens because planning
replaces SubLinks by SubPlans in the subquery's targetlist, and exprTypmod()
is smarter about the former than the latter, causing the apparent type of
the subquery's output columns to change. This seems to be a deficiency we
should fix in exprTypmod(), but that will be a much more invasive patch
with possible side-effects elsewhere, so I'll do that only in HEAD.
Back-patch to 8.3. Arguably the lack of a copying step is broken/dangerous
all the way back, but in the absence of known problems I'll refrain from
making the older branches pay the extra cost. (The reason this particular
symptom didn't appear before is that exprTypmod() wasn't smart about SubLinks
either, until 8.3.)
Teodor Sigaev [Tue, 10 Mar 2009 17:33:53 +0000 (17:33 +0000)]
Prevent recursion during parse of email-like string with multiple '@'.
Patch by Heikki Linnakangas <
[email protected]>
Heikki Linnakangas [Thu, 5 Mar 2009 14:28:04 +0000 (14:28 +0000)]
Add MUST (Mauritius Island Summer Time) to the list of known abbreviations.
Mauritius began using DST in the summer 2008-2009; the Olson library has been
updated already.
Xavier Bugaud
Tom Lane [Wed, 4 Mar 2009 22:08:28 +0000 (22:08 +0000)]
Put back our old workaround for machines that declare cbrt() in math.h but
fail to provide the function itself. Not sure how we escaped testing anything
later than 7.3 on such cases, but they still exist, as per André Volpato's
report about AIX 5.3.
Tom Lane [Tue, 3 Mar 2009 00:17:13 +0000 (00:17 +0000)]
Ooops ... fix some confusion between gettext() and _() in my previous patch.
This has moved around in past releases, so just copying-and-pasting from HEAD
didn't work as intended.
Tom Lane [Mon, 2 Mar 2009 21:18:50 +0000 (21:18 +0000)]
When we are in error recursion trouble, arrange to suppress translation and
encoding conversion of any elog/ereport message being sent to the frontend.
This generalizes a patch that I put in last October, which suppressed
translation of only specific messages known to be associated with recursive
can't-translate-the-message behavior. As shown in bug #4680, we need a more
general answer in order to have some hope of coping with broken encoding
conversion setups. This approach seems a good deal less klugy anyway.
Patch in all supported branches.
Teodor Sigaev [Mon, 2 Mar 2009 15:11:25 +0000 (15:11 +0000)]
Fix usage of char2wchar/wchar2char. Changes:
- pg_wchar and wchar_t could have different size, so char2wchar
doesn't call pg_mb2wchar_with_len to prevent out-of-bound
memory bug
- make char2wchar/wchar2char symmetric, now they should not be
called with C-locale because mbstowcs/wcstombs oftenly doesn't
work correct with C-locale.
- Text parser uses pg_mb2wchar_with_len directly in case of
C-locale and multibyte encoding
Per bug report by Hiroshi Inoue <
[email protected]> and
following discussion.
Backpatch up to 8.2 when multybyte support was implemented in tsearch.
Andrew Dunstan [Sat, 28 Feb 2009 19:13:28 +0000 (19:13 +0000)]
Don't mangle xml and xpath unless xml is not in fact a well-formed document, in xpath(). If mangling xpath, make a saner attempt where xpath expression does not begin with '/'.
Tom Lane [Sat, 28 Feb 2009 18:49:53 +0000 (18:49 +0000)]
Fix buffer allocations in encoding conversion routines so that they won't
fail on zero-length inputs. This isn't an issue in normal use because the
conversion infrastructure skips calling the converters for empty strings.
However a problem was created by yesterday's patch to check whether the
right conversion function is supplied in CREATE CONVERSION. The most
future-proof fix seems to be to make the converters safe for this corner case.
Heikki Linnakangas [Fri, 27 Feb 2009 16:35:31 +0000 (16:35 +0000)]
In CREATE CONVERSION, test that the given function is a valid conversion
function for the specified source and destination encodings. We do that by
calling the function with an empty string. If it can't perform the requested
conversion, it will throw an error.
Backport to 7.4 - 8.3. Per bug report #4680 by Denis Afonin.
Heikki Linnakangas [Fri, 27 Feb 2009 10:27:33 +0000 (10:27 +0000)]
Set isnull for errm and sqlstate local variables when they're free'd. Because
they are out of scope for any code after that anyway, leaving isnull true
should be harmless. However, PL/pgSQL Debugger doesn't seem to care about
the scoping and crashed, per report by Robert Walker (bug #4635). And it's
good to be tidy for debugging purposes too.
Fix in 8.3, 8.2 and 8.1 branches, CVS HEAD was fixed earlier already.
Analysis and fix by Ashesh Vashi and Dave Page.
Tom Lane [Wed, 25 Feb 2009 18:00:07 +0000 (18:00 +0000)]
Fix an old problem in decompilation of CASE constructs: the ruleutils.c code
looks for a CaseTestExpr to figure out what the parser did, but it failed to
consider the possibility that an implicit coercion might be inserted above
the CaseTestExpr. This could result in an Assert failure in some cases
(but correct results if Asserts weren't enabled), or an "unexpected CASE WHEN
clause" error in other cases. Per report from Alan Li.
Back-patch to 8.1; problem doesn't exist before that because CASE was
implemented differently.
Tom Lane [Tue, 24 Feb 2009 01:38:49 +0000 (01:38 +0000)]
Repair a longstanding bug in CLUSTER and the rewriting variants of ALTER
TABLE: if the command is executed by someone other than the table owner (eg,
a superuser) and the table has a toast table, the toast table's pg_type row
ends up with the wrong typowner, ie, the command issuer not the table owner.
This is quite harmless for most purposes, since no interesting permissions
checks consult the pg_type row. However, it could lead to unexpected failures
if one later tries to drop the role that issued the command (in 8.1 or 8.2),
or strange warnings from pg_dump afterwards (in 8.3 and up, which will allow
the DROP ROLE because we don't create a "redundant" owner dependency for table
rowtypes). Problem identified by Cott Lang.
Back-patch to 8.1. The problem is actually far older --- the CLUSTER variant
can be demonstrated in 7.0 --- but it's mostly cosmetic before 8.1 because we
didn't track ownership dependencies before 8.1. Also, fixing it before 8.1
would require changing the call signature of heap_create_with_catalog(), which
seems to carry a nontrivial risk of breaking add-on modules.
Magnus Hagander [Sun, 15 Feb 2009 13:58:22 +0000 (13:58 +0000)]
Loop calling CallNamedPipe() several times in case it fails,
since it can be transient failures, causing kill() to not
properly send signals.
Original patch from Steve Marshall, modified by me.
Tom Lane [Fri, 13 Feb 2009 17:12:10 +0000 (17:12 +0000)]
Fix UNLISTEN to fall out quickly if the current backend has never executed
any LISTEN command. This is more important than it used to be because
DISCARD ALL invokes UNLISTEN. Connection-pooled applications making heavy
use of DISCARD ALL were seeing significant contention for pg_listener,
as reported by Matteo Beccati. It seems unlikely that clients using LISTEN
would use pooled connections, so this simple tweak seems sufficient,
especially since the pg_listener implementation is slated to go away soon
anyway.
Back-patch to 8.3, where DISCARD ALL was introduced.
Tom Lane [Mon, 2 Feb 2009 20:25:43 +0000 (20:25 +0000)]
Fix plpgsql to not treat INSERT INTO as an INTO-variables clause anywhere
in the string, not just at the start. Per bug #4629 from Martin Blazek.
Back-patch to 8.2; prior versions don't have the problem, at least not in
the reported case, because they don't try to recognize INTO in non-SELECT
statements. (IOW, this is really fallout from the RETURNING patch.)
Tom Lane [Fri, 30 Jan 2009 16:59:10 +0000 (16:59 +0000)]
Defend against null input in analyze_requires_snapshot(), per report
from Rushabh Lathia.
Back-patch of patch of 2009-01-08. This is necessary in 8.3, as reported
by Bjorn Munch. It's not currently necessary in 8.2, AFAICS, but seems
best to include it there too.
Marc G. Fournier [Fri, 30 Jan 2009 02:59:29 +0000 (02:59 +0000)]
tag for 8.3.6
Tom Lane [Fri, 30 Jan 2009 00:37:42 +0000 (00:37 +0000)]
Update back-branch release notes.
Peter Eisentraut [Thu, 29 Jan 2009 22:07:53 +0000 (22:07 +0000)]
Translation updates
Tom Lane [Thu, 29 Jan 2009 20:00:07 +0000 (20:00 +0000)]
Update time zone data files to tzdata release 2009a: introduces Asia/Kathmandu
as the preferred spelling of that zone name, corrects historical DST
information for Switzerland and Cuba.
Tom Lane [Thu, 29 Jan 2009 19:23:58 +0000 (19:23 +0000)]
Replace argument-checking Asserts with regular test-and-elog checks in all
encoding conversion functions. These are not can't-happen cases because
it's possible to create a conversion with the wrong conversion function
for the specified encoding pair. That would lead to an Assert crash in
an Assert-enabled build, or incorrect conversion otherwise, neither of
which is desirable. This would be a DOS issue if production databases
were customarily built with asserts enabled, but fortunately that's not so.
Per an observation by Heikki.
Back-patch to all supported branches.
Teodor Sigaev [Thu, 29 Jan 2009 16:09:12 +0000 (16:09 +0000)]
Fix incorrect dereferencing of char* to array's index.
Per Tommy Gildseth <
[email protected]> report
Teodor Sigaev [Wed, 28 Jan 2009 18:32:55 +0000 (18:32 +0000)]
Fix bug with multiple evaluation of tsearch2 compatibility trigger, trigger
data should be restored.
Backpatch only for 8.3 because previous versions haven't such layer.
Magnus Hagander [Wed, 28 Jan 2009 15:06:57 +0000 (15:06 +0000)]
Go over all OpenSSL return values and make sure we compare them
to the documented API value. The previous code got it right as
it's implemented, but accepted too much/too little compared to
the API documentation.
Per comment from Zdenek Kotala.
Magnus Hagander [Wed, 28 Jan 2009 11:19:40 +0000 (11:19 +0000)]
Support running as a service on Windows 7, by not specifying
the JOB_OBJECT_UILIMIT_HANDLES flag.
Dave Page & Magnus Hagander
Bruce Momjian [Thu, 22 Jan 2009 22:56:54 +0000 (22:56 +0000)]
Document that SELECT FOR UPDATE/SHARE with ORDER BY might return results
in the incorrect order, per bug 4593. Backpatch to 8.3.X.
Tom Lane [Sun, 18 Jan 2009 20:44:53 +0000 (20:44 +0000)]
Fix a pg_dump output ordering problem introduced in 8.3 by the addition of
array types for composite types. Although pg_dump understood it wasn't
supposed to dump these array types as separate objects, it must include
them in the dependency ordering analysis, and it was improperly assigning them
the same relatively-high sort priority as regular types. This resulted in
effectively moving composite types and tables up to that same high priority,
which broke any ordering requirements that weren't explicitly enforced by
dependencies. In particular user-defined operator classes, which should come
out before tables, failed to do so. Per report from Brendan Jurd.
In passing, also fix an ill-considered decision to give text search objects
the same sort priority as functions and operators --- the sort result looks
a lot nicer if different object types are kept separate. The recent
foreign-data patch had copied that decision, making the sort ordering even
messier :-(
Heikki Linnakangas [Thu, 15 Jan 2009 18:23:17 +0000 (18:23 +0000)]
Change explanation of pg_switch_xlog()'s return value to match code.
Teodor Sigaev [Thu, 15 Jan 2009 17:06:03 +0000 (17:06 +0000)]
Fix URL generation in headline. Only tag lexeme will be replaced by space.
Per http://archives.postgresql.org/pgsql-bugs/2008-12/msg00013.php
Teodor Sigaev [Thu, 15 Jan 2009 17:05:39 +0000 (17:05 +0000)]
Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
Heikki Linnakangas [Wed, 14 Jan 2009 09:53:54 +0000 (09:53 +0000)]
Remove broken Assertions that failed if a statement executed in PL/pgSQL is
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.
Magnus Hagander [Tue, 13 Jan 2009 11:45:03 +0000 (11:45 +0000)]
Throw an error when using -C and -1 at the same time in pg_restore.
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.
Bruce Momjian [Fri, 9 Jan 2009 01:47:14 +0000 (01:47 +0000)]
Update release notes for 8.3.5, 8.2.11, and 8.1.15 to mention the need
to reindex GiST indexes:
If you were running a previous 8.X.X release, REINDEX all GiST
indexes after the upgrade.
Tom Lane [Wed, 7 Jan 2009 20:39:05 +0000 (20:39 +0000)]
Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,
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.
Tom Lane [Tue, 6 Jan 2009 17:27:19 +0000 (17:27 +0000)]
Remove references to pgsql-ports and pgsql-patches mailing lists from
various documentation, since those lists are now dead/deprecated.
Point to pgsql-bugs and/or pgsql-hackers as appropriate.
Heikki Linnakangas [Tue, 6 Jan 2009 14:55:44 +0000 (14:55 +0000)]
Fix logic in lazy vacuum to decide if it's worth trying to truncate the heap.
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.
Joe Conway [Sat, 3 Jan 2009 19:57:54 +0000 (19:57 +0000)]
Fix bug per Oleksiy Shchukin - 2nd argument for dblink_get_result(text,bool)
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.
Tom Lane [Thu, 1 Jan 2009 17:12:24 +0000 (17:12 +0000)]
Fix an oversight in my patch of a couple weeks ago that ensured a snapshot
is available during datatype input in Bind message processing. I put the
PopActiveSnapshot() or equivalent just before PortalDefineQuery, which is
an unsafe spot for it (in 8.3 and later) because we are carrying a plancache
refcount that hasn't yet been assigned to the portal. Any error thrown there
would result in leaking the refcount. It's not exactly likely that
PopActiveSnapshot would throw an elog, perhaps, but it could happen.
Reorder the code and add another comment warning not to do that.
Tom Lane [Tue, 30 Dec 2008 03:59:28 +0000 (03:59 +0000)]
Fix oversight in ALTER TABLE ENABLE/DISABLE RULE patch: the new enabled
field needs to be included in equalRuleLocks() comparisons, else updates
will fail to propagate into relcache entries when they have positive
reference count (ie someone is using the relcache entry).
Per report from Alex Hunsaker.
Tom Lane [Tue, 16 Dec 2008 16:26:14 +0000 (16:26 +0000)]
Make heap_update() set newtup->t_tableOid correctly, for consistency with
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.
Tom Lane [Mon, 15 Dec 2008 16:52:16 +0000 (16:52 +0000)]
Remove newly-added regression test cases that referenced pg_stats.
The proposed fix for this is a behavioral change that probably shouldn't
get back-patched, and it doesn't seem worth putting a workaround into
a back branch.
Tom Lane [Sun, 14 Dec 2008 19:46:02 +0000 (19:46 +0000)]
Restore enforce_generic_type_consistency's pre-8.3 behavior of allowing an
actual argument type of ANYARRAY to match an argument declared ANYARRAY,
so long as ANYELEMENT etc aren't used. I had overlooked the fact that this
is a possible case while fixing bug #3852; but it is possible because
pg_statistic contains columns declared ANYARRAY. Per gripe from Corey Horton.
Tom Lane [Sat, 13 Dec 2008 02:00:30 +0000 (02:00 +0000)]
Fix failure to ensure that a snapshot is available to datatype input functions
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.
Magnus Hagander [Mon, 8 Dec 2008 20:31:00 +0000 (20:31 +0000)]
Clearify how processes are started by autovacuum, and what the effect
of autovacuum_max_workers parameter is.
Per discussion with Alvaro.
Magnus Hagander [Mon, 8 Dec 2008 15:11:42 +0000 (15:11 +0000)]
Add note that autovacuum can use up several times maintenance_work_mem,
with warning against setting it too high.
Teodor Sigaev [Thu, 4 Dec 2008 11:10:06 +0000 (11:10 +0000)]
Initialize GISTScanOpaque->qual_ok even if there is no conditions.
Tom Lane [Mon, 1 Dec 2008 21:06:20 +0000 (21:06 +0000)]
Fix an oversight in the code that makes transitive-equality deductions from
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.
Tom Lane [Mon, 1 Dec 2008 17:06:27 +0000 (17:06 +0000)]
Ensure that the contents of a holdable cursor don't depend on out-of-line
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.
Tom Lane [Sun, 30 Nov 2008 23:24:01 +0000 (23:24 +0000)]
Fix dblink and tablefunc to not return with the wrong CurrentMemoryContext.
Per buildfarm results.
Tom Lane [Sun, 30 Nov 2008 18:49:42 +0000 (18:49 +0000)]
Remove inappropriate memory context switch in shutdown_MultiFuncCall().
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.
Tom Lane [Thu, 27 Nov 2008 00:34:49 +0000 (00:34 +0000)]
Back-patch change to make DISCARD ALL release advisory locks.
Per discussion.
Michael Meskes [Wed, 26 Nov 2008 15:37:01 +0000 (15:37 +0000)]
Replaced strchrnul by strchr.
Michael Meskes [Wed, 26 Nov 2008 13:19:34 +0000 (13:19 +0000)]
When creating a varchar struct name braces must be discarded.
Tom Lane [Tue, 25 Nov 2008 20:47:49 +0000 (20:47 +0000)]
information_schema.key_column_usage.position_in_unique_constraint was
misdocumented as not being implemented. In reality it has worked since
the release of 8.2.
Peter Eisentraut [Sat, 15 Nov 2008 20:53:40 +0000 (20:53 +0000)]
Fix crash of xmlconcat(NULL)
backpatch from 8.4devel
Tom Lane [Thu, 13 Nov 2008 17:42:19 +0000 (17:42 +0000)]
Prevent synchronous scan during GIN index build, because GIN is optimized
for inserting tuples in increasing TID order. It's not clear whether this
fully explains Ivan Sergio Borgonovo's complaint, but simple testing
confirms that a scan that doesn't start at block 0 can slow GIN build by
a factor of three or four.
Backpatch to 8.3. Sync scan didn't exist before that.
Peter Eisentraut [Thu, 13 Nov 2008 14:37:32 +0000 (14:37 +0000)]
Since the xmlagg section was moved, "below" is no longer accurate.
Tom Lane [Wed, 12 Nov 2008 23:08:42 +0000 (23:08 +0000)]
In predtest.c, install a limit on the number of branches we will process in
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.)
Heikki Linnakangas [Wed, 12 Nov 2008 10:10:43 +0000 (10:10 +0000)]
Fix off-by-one error in autovacuum shmem struct sizing. This could lead to
autovacuum worker sending SIGUSR1 signal to wrong process, per Zou Yong's
report.
Backpatch to 8.3.
Andrew Dunstan [Wed, 12 Nov 2008 00:00:29 +0000 (00:00 +0000)]
Detect and error out on inability to get proper linkage information required for plperl, usually due to absence of perl ExtUtils::Embed module. Backpatch as far as 8.1.
Magnus Hagander [Tue, 11 Nov 2008 20:06:25 +0000 (20:06 +0000)]
Mention the tup_fetched column in pg_stat_database.
Greg Sabino Mullane
Tom Lane [Tue, 11 Nov 2008 18:13:44 +0000 (18:13 +0000)]
Get rid of adjust_appendrel_attr_needed(), which has been broken ever since
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.