Tom Lane [Sat, 2 May 2009 20:18:21 +0000 (20:18 +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-old.sgml
Tom Lane [Fri, 1 May 2009 19:29:42 +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:34 +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:53:26 +0000 (15:53 +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.
Magnus Hagander [Wed, 15 Apr 2009 18:58:26 +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.
Teodor Sigaev [Tue, 7 Apr 2009 17:49:40 +0000 (17:49 +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 [Tue, 7 Apr 2009 15:54:30 +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.
Tom Lane [Sat, 4 Apr 2009 04:54:07 +0000 (04:54 +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 [Tue, 31 Mar 2009 22:56:28 +0000 (22:56 +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.
Marc G. Fournier [Fri, 13 Mar 2009 02:39:42 +0000 (02:39 +0000)]
tag 7.4.25
Tom Lane [Thu, 12 Mar 2009 22:36:46 +0000 (22:36 +0000)]
Update back-branch release notes.
Tom Lane [Thu, 12 Mar 2009 00:54:04 +0000 (00:54 +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.
Heikki Linnakangas [Thu, 5 Mar 2009 14:29:26 +0000 (14:29 +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:53 +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:44 +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:19:23 +0000 (21:19 +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.
Tom Lane [Sat, 28 Feb 2009 18:50:25 +0000 (18:50 +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:53 +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.
Marc G. Fournier [Fri, 30 Jan 2009 03:54:33 +0000 (03:54 +0000)]
tag 7.4.24
Tom Lane [Fri, 30 Jan 2009 00:38:26 +0000 (00:38 +0000)]
Update back-branch release notes.
Peter Eisentraut [Thu, 29 Jan 2009 22:02:17 +0000 (22:02 +0000)]
Translation updates
Tom Lane [Thu, 29 Jan 2009 19:25:15 +0000 (19:25 +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.
Magnus Hagander [Wed, 28 Jan 2009 15:06:48 +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.
Teodor Sigaev [Fri, 16 Jan 2009 12:10:34 +0000 (12:10 +0000)]
Fix uninitialized variables in get_covers
Teodor Sigaev [Thu, 15 Jan 2009 18:30:10 +0000 (18:30 +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 18:29:47 +0000 (18:29 +0000)]
Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
Alvaro Herrera [Tue, 13 Jan 2009 15:28:42 +0000 (15:28 +0000)]
Backpatch to 7.4 the part of 1.84 (from the 8.0 timeline) that wasn't already
patched, viz. str_numth(). The rest of that patch was already applied as part
of 1.69.2.1. Per report and patch from Andreas 'ads' Scherbaum.
The involved revisions were:
revision 1.84
date: 2005-01-12 22:40:13 -0300; author: tgl; state: Exp; lines: +9 -7;
branches: 1.84.4;
Remove unportable assumption that it's okay to use the target buffer
of an sprintf() as a source string. Demonstrably does not work with
recent gcc and/or glibc on some platforms.
and
revision 1.69.2.1
date: 2005-03-25 20:42:21 -0400; author: tgl; state: Exp; lines: +24 -8;
Prevent to_char(interval) from dumping core on month-related formats
when a zero-month interval is given. Per discussion with Karel.
Tom Lane [Tue, 6 Jan 2009 17:28:15 +0000 (17:28 +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:56:13 +0000 (14:56 +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.
repo-copy [Tue, 30 Dec 2008 17:11:27 +0000 (17:11 +0000)]
Repo copy files
Marc G. Fournier [Fri, 31 Oct 2008 03:15:21 +0000 (03:15 +0000)]
tag 7.4.23
Tom Lane [Thu, 30 Oct 2008 22:23:39 +0000 (22:23 +0000)]
Update back-branch release notes.
Peter Eisentraut [Thu, 30 Oct 2008 19:19:35 +0000 (19:19 +0000)]
Translation updates
Tom Lane [Mon, 27 Oct 2008 19:37:56 +0000 (19:37 +0000)]
Install a more robust solution for the problem of infinite error-processing
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.
Teodor Sigaev [Fri, 17 Oct 2008 17:44:15 +0000 (17:44 +0000)]
Fix small bug in headline generation.
Patch from Sushant Sinha <
[email protected]>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
Tom Lane [Thu, 16 Oct 2008 13:23:57 +0000 (13:23 +0000)]
Fix SPI_getvalue and SPI_getbinval to range-check the given attribute number
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.
Michael Meskes [Fri, 10 Oct 2008 12:19:03 +0000 (12:19 +0000)]
Optional argument should be optional.
Tom Lane [Thu, 2 Oct 2008 13:48:12 +0000 (13:48 +0000)]
Fix improper display of fractional seconds in interval values
when using --enable-integer-datetimes and a non-ISO datestyle.
Ron Mayer
Marc G. Fournier [Fri, 19 Sep 2008 03:30:27 +0000 (03:30 +0000)]
tag for 7.4.22
Tom Lane [Fri, 19 Sep 2008 02:46:08 +0000 (02:46 +0000)]
Update back-branch release notes.
Tom Lane [Tue, 26 Aug 2008 00:03:52 +0000 (00:03 +0000)]
Fix pg_dump docs to acknowledge that you can use -Z with plain text output. Pointed out by Daniel Migowski.
Tom Lane [Sat, 16 Aug 2008 02:25:38 +0000 (02:25 +0000)]
Fix pg_dump/pg_restore's ExecuteSqlCommand() to behave suitably if PQexec
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.
Tom Lane [Tue, 5 Aug 2008 21:29:01 +0000 (21:29 +0000)]
Do not allow Unique nodes to be scanned backwards. The code claimed that it
would work, but in fact it didn't return the same rows when moving backwards
as when moving forwards. This would have no visible effect in a DISTINCT
query (at least assuming the column datatypes use a strong definition of
equality), but it gave entirely wrong answers for DISTINCT ON queries.
Tom Lane [Tue, 8 Jul 2008 22:18:18 +0000 (22:18 +0000)]
Fix performance bug in write_syslog(): the code to preferentially break the
log message at newlines cost O(N^2) for very long messages with few or no
newlines. For messages in the megabyte range this became the dominant cost.
Per gripe from Achilleas Mantzios.
Patch all the way back, since this is a safe change with no portability
risks. I am also thinking of increasing PG_SYSLOG_LIMIT, but that should
be done separately.
Tom Lane [Mon, 7 Jul 2008 20:25:40 +0000 (20:25 +0000)]
Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
results always contribute two groups, regardless of the expression contents.
This is very substantially more accurate than the regular heuristic for
certain boolean tests like "col IS NULL". Per gripe from Sam Mason.
Back-patch to all supported releases, since the behavior of
estimate_num_groups() hasn't changed all that much since 7.4.
Tom Lane [Tue, 10 Jun 2008 18:09:26 +0000 (18:09 +0000)]
Create a script to handle stamping release version numbers into files,
replacing the tedious and error-prone manual process we've been using.
branch-fixup [Tue, 10 Jun 2008 18:08:48 +0000 (18:08 +0000)]
Add files from parent branch HEAD:
src/tools/version_stamp.pl
Tom Lane [Mon, 9 Jun 2008 19:34:40 +0000 (19:34 +0000)]
Fix datetime input functions to correctly detect integer overflow when
running on a 64-bit platform ... strtol() will happily return 64-bit
output in that case. Per bug #4231 from Geoff Tolley.
Tom Lane [Mon, 9 Jun 2008 00:16:58 +0000 (00:16 +0000)]
tag 7.4.21
Tom Lane [Sun, 8 Jun 2008 22:15:45 +0000 (22:15 +0000)]
Stamp 7.4.21 (except for configure.in/configure)
Tom Lane [Sat, 7 Jun 2008 22:11:40 +0000 (22:11 +0000)]
Update release notes for 8.3.3 et al.
Tom Lane [Fri, 6 Jun 2008 18:00:09 +0000 (18:00 +0000)]
Fix pg_get_ruledef() so that negative numeric constants are parenthesized.
This is needed because :: casting binds more tightly than minus, so for
example -1::integer is not the same as (-1)::integer, and there are cases
where the difference is important. In particular this caused a failure
in SELECT DISTINCT ... ORDER BY ... where expressions that should have
matched were seen as different by the parser; but I suspect that there
could be other cases where failure to parenthesize leads to subtler
semantic differences in reloaded rules. Per report from Alexandr Popov.
Tom Lane [Fri, 6 Jun 2008 05:34:03 +0000 (05:34 +0000)]
Remove link that pre-8.2 doc tools don't support.
Tom Lane [Fri, 6 Jun 2008 04:37:07 +0000 (04:37 +0000)]
tag 7.4.20
Tom Lane [Thu, 5 Jun 2008 23:56:42 +0000 (23:56 +0000)]
Stamp 7.4.20 (except for configure.in/configure)
Tom Lane [Thu, 5 Jun 2008 23:38:03 +0000 (23:38 +0000)]
Translation updates.
Tom Lane [Wed, 4 Jun 2008 03:17:01 +0000 (03:17 +0000)]
Draft release notes for upcoming back-branch updates.
Tom Lane [Wed, 28 May 2008 00:46:12 +0000 (00:46 +0000)]
Improve GRANT documentation to point out that UPDATE and DELETE typically
require SELECT privilege as well, since you normally need to read existing
column values within such commands. This behavior is according to spec,
but we'd never documented it before. Per gripe from Volkan Yazici.
Tom Lane [Tue, 27 May 2008 21:14:00 +0000 (21:14 +0000)]
Back-patch the 8.3 fix that prohibits TRUNCATE, CLUSTER, and REINDEX when the
current transaction has any open references to the target relation or index
(implying it has an active query using the relation). Also back-patch the
8.2 fix that prohibits TRUNCATE and CLUSTER when there are pending
AFTER-trigger events. Per suggestion from Heikki.
Tom Lane [Sun, 25 May 2008 21:51:38 +0000 (21:51 +0000)]
Adjust timestamp regression tests to prevent two low-probability failure
cases. Recent buildfarm experience shows that it is sometimes possible
to execute several SQL commands in less time than the granularity of
Windows' not-very-high-resolution gettimeofday(), leading to a failure
because the tests expect the value of now() to change and it doesn't.
Also, it was recognized some time ago that the same area of the tests
could fail if local midnight passes between the insertion and the checking
of the values for 'yesterday', 'tomorrow', etc. Clean all this up per
ideas from myself and Greg Stark.
There remains a window for failure if the transaction block is entered
exactly at local midnight (so that 'now' and 'today' have the same value),
but that seems low-probability enough to live with.
Since the point of this change is mostly to eliminate buildfarm noise,
back-patch to all versions we are still actively testing.
Magnus Hagander [Tue, 13 May 2008 20:53:54 +0000 (20:53 +0000)]
Don't try to close negative file descriptors, since this can cause
crashes on certain platforms. In particular, the MSVC runtime is known
to do this.
Fixes bug #4162, reported and diagnosed by Javier Pimas
Tom Lane [Fri, 9 May 2008 22:38:05 +0000 (22:38 +0000)]
Fix an ancient oversight in change_varattnos_of_a_node: it neglected to update
varoattno along with varattno. This resulted in having Vars that were not
seen as equal(), causing inheritance of the "same" constraint from different
parent relations to fail. An example is
create table pp1 (f1 int check (f1>0));
create table cc1 (f2 text, f3 int) inherits (pp1);
create table cc2(f4 float) inherits(pp1,cc1);
Backpatch as far as 7.4. (The test case still fails in 7.4, for reasons
that I don't feel like investigating at the moment.)
This is a backpatch commit only. The fix will be applied in HEAD as part
of the upcoming pg_constraint patch.
Magnus Hagander [Tue, 22 Apr 2008 09:26:34 +0000 (09:26 +0000)]
Replace developer FAQ with a reference to the wiki, which is where
it now lives (per discussion). Leave the other FAQs alone for now.
Magnus Hagander [Mon, 21 Apr 2008 09:44:54 +0000 (09:44 +0000)]
Add link to major version release notes at the top of the minor
version ones, to make it clear to users just browsing the notes
that there are a lot more changes available from whatever version
they are at than what's in the minor version release notes.
Tom Lane [Fri, 11 Apr 2008 22:53:33 +0000 (22:53 +0000)]
Fix several datatype input functions that were allowing unused bytes in their
results to contain uninitialized, unpredictable values. While this was okay
as far as the datatypes themselves were concerned, it's a problem for the
parser because occurrences of the "same" literal might not be recognized as
equal by datumIsEqual (and hence not by equal()). It seems sufficient to fix
this in the input functions since the only critical use of equal() is in the
parser's comparisons of ORDER BY and DISTINCT expressions.
Per a trouble report from Marc Cousin.
Patch all the way back. Interestingly, array_in did not have the bug before
8.2, which may explain why the issue went unnoticed for so long.
Michael Meskes [Thu, 10 Apr 2008 10:46:56 +0000 (10:46 +0000)]
Fixed bug in PGTYPEStimestamp_sub that used pointers instead of the values to substract.
Tom Lane [Sat, 5 Apr 2008 01:59:01 +0000 (01:59 +0000)]
Defend against JOINs having more than 32K columns altogether. We cannot
currently support this because we must be able to build Vars referencing
join columns, and varattno is only 16 bits wide. Perhaps this should be
improved in future, but considering that it never came up before, I'm not
sure the problem is worth much effort. Per bug #4070 from Marcello
Ceschia.
The problem seems largely academic in 8.0 and 7.4, because they have
(different) O(N^2) performance issues with such wide joins, but
back-patch all the way anyway.
Tom Lane [Tue, 25 Mar 2008 19:31:53 +0000 (19:31 +0000)]
Adjust DatumGetBool macro so that it isn't fooled by garbage in the Datum
to the left of the actual bool value. While in most cases there won't be
any, our support for old-style user-defined functions violates the C spec
to the extent of calling functions that might return char or short through
a function pointer declared to return "char *", which we then coerce to
Datum. It is not surprising that the result might contain garbage
high-order bits ... what is surprising is that we didn't see such cases
long ago. Per report from Magnus.
This is a back-patch of a change that was made in HEAD almost exactly
a year ago. I had refrained from back-patching at the time, but now
we find that this is *necessary* for contrib to work with gcc 4.3.
Heikki Linnakangas [Thu, 20 Mar 2008 10:52:57 +0000 (10:52 +0000)]
Add the missing cyrillic "Yo" characters ('e' and 'E' with two dots) to the
ISO_8859-5 <-> MULE_INTERNAL conversion tables.
This was discovered when trying to convert a string containing those characters
from ISO_8859-5 to Windows-1251, because we use MULE_INTERNAL/KOI8R as an
intermediate encoding between those two.
While the missing "Yo" was just an omission in the conversion tables, there are
a few other characters like the "Numero" sign ("No" as a single character) that
exists in all the other cyrillic encodings (win1251, ISO_8859-5 and cp866), but
not in KOI8R. Added comments about that.
Patch by Sergey Burladyan. Back-patch to 7.4.
Tom Lane [Wed, 19 Mar 2008 02:41:15 +0000 (02:41 +0000)]
Fix regexp substring matching (substring(string from pattern)) for the corner
case where there is a match to the pattern overall but the user has specified
a parenthesized subexpression and that subexpression hasn't got a match.
An example is substring('foo' from 'foo(bar)?'). This should return NULL,
since (bar) isn't matched, but it was mistakenly returning the whole-pattern
match instead (ie, 'foo'). Per bug #4044 from Rui Martins.
This has been broken since the beginning; patch in all supported versions.
The old behavior was sufficiently inconsistent that it's impossible to believe
anyone is depending on it.
Tom Lane [Wed, 12 Mar 2008 20:12:48 +0000 (20:12 +0000)]
Fix LISTEN/NOTIFY race condition reported by Laurent Birtz, by postponing
pg_listener modifications commanded by LISTEN and UNLISTEN until the end
of the current transaction. This allows us to hold the ExclusiveLock on
pg_listener until after commit, with no greater risk of deadlock than there
was before. Aside from fixing the race condition, this gets rid of a
truly ugly kludge that was there before, namely having to ignore
HeapTupleBeingUpdated failures during NOTIFY. There is a small potential
incompatibility, which is that if a transaction issues LISTEN or UNLISTEN
and then looks into pg_listener before committing, it won't see any resulting
row insertion or deletion, where before it would have. It seems unlikely
that anyone would be depending on that, though.
Alvaro Herrera [Wed, 5 Mar 2008 21:20:49 +0000 (21:20 +0000)]
Add support for dlopen on recent NetBSD/MIPS, per Rémi Zara.
Tom Lane [Wed, 27 Feb 2008 17:45:02 +0000 (17:45 +0000)]
If RelationBuildDesc() fails to open a critical system index, PANIC with
a relevant error message instead of just dumping core. Odd that nobody
reported this before Darren Reed.
Tom Lane [Sun, 24 Feb 2008 05:22:44 +0000 (05:22 +0000)]
Use our own getopt() and getopt_long() on Solaris, because that platform's
versions don't handle long options the way we want. Per Zdenek Kotala.
Tom Lane [Sat, 23 Feb 2008 19:24:09 +0000 (19:24 +0000)]
Avoid trying to print a NULL char pointer in --describe-config. On some
platforms this works, but on some it crashes. Zdenek Kotala
Tom Lane [Mon, 11 Feb 2008 19:15:00 +0000 (19:15 +0000)]
Repair VACUUM FULL bug introduced by HOT patch: the original way of
calculating a page's initial free space was fine, and should not have been
"improved" by letting PageGetHeapFreeSpace do it. VACUUM FULL is going to
reclaim LP_DEAD line pointers later, so there is no need for a guard
against the page being too full of line pointers, and having one risks
rejecting pages that are perfectly good move destinations.
This also exposed a second bug, which is that the empty_end_pages logic
assumed that any page with no live tuples would get entered into the
fraged_pages list automatically (by virtue of having more free space than
the threshold in the do_frag calculation). This assumption certainly
seems risky when a low fillfactor has been chosen, and even without
tunable fillfactor I think it could conceivably fail on a page with many
unused line pointers. So fix the code to force do_frag true when notup
is true, and patch this part of the fix all the way back.
Per report from Tomas Szepe.
Tom Lane [Mon, 14 Jan 2008 18:46:49 +0000 (18:46 +0000)]
Fix an ancient oversight in libpq's handling of V3-protocol COPY OUT mode:
we need to be able to swallow NOTICE messages, and potentially also
ParameterStatus messages (although the latter would be a bit weird),
without exiting COPY OUT state. Fix it, and adjust the protocol documentation
to emphasize the need for this. Per off-list report from Alexander Galler.
Tom Lane [Sun, 6 Jan 2008 01:03:46 +0000 (01:03 +0000)]
A long time ago, Peter pointed out that ruleutils.c didn't dump simple
constant ORDER/GROUP BY entries properly:
http://archives.postgresql.org/pgsql-hackers/2001-04/msg00457.php
The original solution to that was in fact no good, as demonstrated by
today's report from Martin Pitt:
http://archives.postgresql.org/pgsql-bugs/2008-01/msg00027.php
We can't use the column-number-reference format for a constant that is
a resjunk targetlist entry, a case that was unfortunately not thought of
in the original discussion. What we can do instead (which did not work
at the time, but does work in 7.3 and up) is to emit the constant with
explicit ::typename decoration, even if it otherwise wouldn't need it.
This is sufficient to keep the parser from thinking it's a column number
reference, and indeed is probably what the user must have done to get
such a thing into the querytree in the first place.
Tom Lane [Thu, 3 Jan 2008 21:42:17 +0000 (21:42 +0000)]
Stamp release 7.4.19.
Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067, CVE-2007-6600, CVE-2007-6601
Tom Lane [Thu, 3 Jan 2008 21:36:15 +0000 (21:36 +0000)]
Update release notes for security releases.
Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067, CVE-2007-6600, CVE-2007-6601
Tom Lane [Thu, 3 Jan 2008 21:28:55 +0000 (21:28 +0000)]
The original patch to disallow non-passworded connections to non-superusers
failed to cover all the ways in which a connection can be initiated in dblink.
Plug the remaining holes. Also, disallow transient connections in functions
for which that feature makes no sense (because they are only sensible as
part of a sequence of operations on the same connection). Joe Conway
Security: CVE-2007-6601
Tom Lane [Thu, 3 Jan 2008 21:25:34 +0000 (21:25 +0000)]
Make standard maintenance operations (including VACUUM, ANALYZE, REINDEX,
and CLUSTER) execute as the table owner rather than the calling user, using
the same privilege-switching mechanism already used for SECURITY DEFINER
functions. The purpose of this change is to ensure that user-defined
functions used in index definitions cannot acquire the privileges of a
superuser account that is performing routine maintenance. While a function
used in an index is supposed to be IMMUTABLE and thus not able to do anything
very interesting, there are several easy ways around that restriction; and
even if we could plug them all, there would remain a risk of reading sensitive
information and broadcasting it through a covert channel such as CPU usage.
To prevent bypassing this security measure, execution of SET SESSION
AUTHORIZATION and SET ROLE is now forbidden within a SECURITY DEFINER context.
Thanks to Itagaki Takahiro for reporting this vulnerability.
Security: CVE-2007-6600
Tom Lane [Thu, 3 Jan 2008 20:49:15 +0000 (20:49 +0000)]
Fix assorted security-grade bugs in the regex engine. All of these problems
are shared with Tcl, since it's their code to begin with, and the patches
have been copied from Tcl 8.5.0. Problems:
CVE-2007-4769: Inadequate check on the range of backref numbers allows
crash due to out-of-bounds read.
CVE-2007-4772: Infinite loop in regex optimizer for pattern '($|^)*'.
CVE-2007-6067: Very slow optimizer cleanup for regex with a large NFA
representation, as well as crash if we encounter an out-of-memory condition
during NFA construction.
Part of the response to CVE-2007-6067 is to put a limit on the number of
states in the NFA representation of a regex. This seems needed even though
the within-the-code problems have been corrected, since otherwise the code
could try to use very large amounts of memory for a suitably-crafted regex,
leading to potential DOS by driving the system into swap, activating a kernel
OOM killer, etc.
Although there are certainly plenty of ways to drive the system into effective
DOS with poorly-written SQL queries, these problems seem worth treating as
security issues because many applications might accept regex search patterns
from untrustworthy sources.
Thanks to Will Drewry of Google for reporting these problems. Patches by Will
Drewry and Tom Lane.
Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067
Tom Lane [Wed, 2 Jan 2008 22:05:36 +0000 (22:05 +0000)]
Insert ARST into the list of known timezone abbreviations.
Magnus Hagander [Wed, 2 Jan 2008 19:53:15 +0000 (19:53 +0000)]
Fix invalid ipv6 address in example. Per doc comment 7211.
Bruce Momjian [Mon, 31 Dec 2007 17:27:57 +0000 (17:27 +0000)]
Provide a more helpful error message when there is an autoconf version
mismatch; backpatch.
Tom Lane [Tue, 18 Dec 2007 00:04:37 +0000 (00:04 +0000)]
Make path_recv() and poly_recv() reject paths/polygons containing no points.
The zero-point case is sensible so far as the data structure is concerned,
so maybe we ought to allow it sometime; but right now the textual input
routines for these types don't allow it, and it seems that not all the
functions for the types are prepared to cope.
Report and patch by Merlin Moncure.
Peter Eisentraut [Mon, 26 Nov 2007 12:09:58 +0000 (12:09 +0000)]
Require a specific Autoconf version, instead of a lower bound only.
Alvaro Herrera [Fri, 23 Nov 2007 01:48:08 +0000 (01:48 +0000)]
Fix buggy usage of vsnprintf in PL/Python by removing it altogether, instead
relying on stringinfo.c. This fixes a problem reported by Marko Kreen, but I
didn't use his patch, per subsequent discussion.
Tatsuo Ishii [Fri, 23 Nov 2007 00:39:59 +0000 (00:39 +0000)]
Fix "Page Layout" table. The second row should be ItemIdData, not
ItemPointerData.
Teodor Sigaev [Fri, 16 Nov 2007 17:31:16 +0000 (17:31 +0000)]
Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <
[email protected]>
Joe Conway [Sat, 10 Nov 2007 05:02:22 +0000 (05:02 +0000)]
Have crosstab variants treat NULL rowid as a category in its own right,
per suggestion from Tom Lane. This fixes crash-bug reported by Stefan
Schwarzer.
Tom Lane [Thu, 8 Nov 2007 23:23:23 +0000 (23:23 +0000)]
If an index depends on no columns of its table, give it a dependency on the
whole table instead, to ensure that it goes away when the table is dropped.
Per bug #3723 from Sam Mason.
Backpatch as far as 7.4; AFAICT 7.3 does not have the issue, because it doesn't
have general-purpose expression indexes and so there must be at least one
column referenced by an index.
Michael Meskes [Tue, 6 Nov 2007 08:33:32 +0000 (08:33 +0000)]
Added missing clause to parser.
Tom Lane [Thu, 11 Oct 2007 21:28:30 +0000 (21:28 +0000)]
Ensure that the result of evaluating a function during constant-expression
simplification gets detoasted before it is incorporated into a Const node.
Otherwise, if an immutable function were to return a TOAST pointer (an
unlikely case, but it can be made to happen), we would end up with a plan
that depends on the continued existence of the out-of-line toast datum.
Tom Lane [Thu, 4 Oct 2007 20:45:17 +0000 (20:45 +0000)]
Keep the planner from failing on "WHERE false AND something IN (SELECT ...)".
eval_const_expressions simplifies this to just "WHERE false", but we have
already done pull_up_IN_clauses so the IN join will be done, or at least
planned, anyway. The trouble case comes when the sub-SELECT is itself a join
and we decide to implement the IN by unique-ifying the sub-SELECT outputs:
with no remaining reference to the output Vars in WHERE, we won't have
propagated the Vars up to the upper join point, leading to "variable not found
in subplan target lists" error. Fix by adding an extra scan of in_info_list
and forcing all Vars mentioned therein to be propagated up to the IN join
point. Per bug report from Miroslav Sulc.
Teodor Sigaev [Wed, 26 Sep 2007 10:44:54 +0000 (10:44 +0000)]
Fix crash of to_tsvector() function on huge input: compareWORD()
function didn't return correct result for word position greate than
limit.
Per report from Stuart Bishop <
[email protected]>
Tom Lane [Sat, 22 Sep 2007 05:36:14 +0000 (05:36 +0000)]
Fix bogus calculation of potential output string length in translate().
Tom Lane [Sun, 16 Sep 2007 03:03:55 +0000 (03:03 +0000)]
Update release notes for last-minute fix.