Commit Graph

20172 Commits

Author SHA1 Message Date
Marc G. Fournier
287e6acae8 commit first then tag 8.0.20 2009-01-30 04:59:15 +00:00
Tom Lane
e4f5645d72 Update back-branch release notes. 2009-01-30 00:38:14 +00:00
Peter Eisentraut
4919f74177 Translation updates 2009-01-29 22:04:05 +00:00
Tom Lane
fba3896cb4 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.
2009-01-29 20:00:32 +00:00
Tom Lane
7612c1d813 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.
2009-01-29 19:25:01 +00:00
Magnus Hagander
5ecd9dc75a 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.
2009-01-28 15:06:51 +00:00
Teodor Sigaev
473b40d23e Fix uninitialized variables in get_covers 2009-01-16 12:09:30 +00:00
Teodor Sigaev
b7394a6e6e Fix URL generation in headline. Only tag lexeme will be replaced by space.
Per http://archives.postgresql.org/pgsql-bugs/2008-12/msg00013.php
2009-01-15 18:17:12 +00:00
Teodor Sigaev
696dbd873d Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
2009-01-15 18:16:52 +00:00
Tom Lane
0cdeea0e54 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.
2009-01-06 17:28:01 +00:00
Heikki Linnakangas
fea5ec5263 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.
2009-01-06 14:56:03 +00:00
Marc G. Fournier
d297635721 tag for 8.0.19 2008-10-31 02:54:50 +00:00
Tom Lane
f1ac413466 Update back-branch release notes. 2008-10-30 22:23:25 +00:00
Peter Eisentraut
60278b1cc8 Translation updates 2008-10-30 19:21:26 +00:00
Tom Lane
ed0f09a0af Update time zone data files to tzdata release 2008i (DST law changes in
Argentina, Brazil, Mauritius, Syria).
2008-10-30 13:17:23 +00:00
Peter Eisentraut
28faad52c7 Missing space in error message 2008-10-30 12:16:32 +00:00
Tom Lane
d24efb83ee 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.
2008-10-27 19:37:48 +00:00
Tom Lane
b1b2140035 Fix an old bug in after-trigger handling: AfterTriggerEndQuery took the
address of afterTriggers->query_stack[afterTriggers->query_depth] and hung
onto it through all its firings of triggers.  However, if a trigger causes
sufficiently many nested query executions, query_stack will get repalloc'd
bigger, leaving AfterTriggerEndQuery --- and hence afterTriggerInvokeEvents
--- using a stale pointer.

So far as I can find, the only consequence of this error is to stomp on a
couple of words of already-freed memory; which would lead to a failure only if
that chunk had already gotten re-allocated for something else.  So it's hard
to exhibit a simple failure case, but this is surely a bug.

I noticed this while working on my recent patch to reduce pending-trigger
space usage.  The present patch is mighty ugly, because it requires making
afterTriggerInvokeEvents know about all the possible event lists it might get
called on.  Fortunately, this is only needed in back branches because CVS HEAD
avoids the problem in a different way: afterTriggerInvokeEvents only touches
the passed AfterTriggerEventList pointer once at startup.  Back branches are
stable enough that wiring in knowledge of all possible call usages doesn't
seem like a killer problem.

Back-patch to 8.0.  7.4's trigger code is completely different and doesn't
seem to have the problem (it doesn't even use repalloc).
2008-10-25 03:33:05 +00:00
Teodor Sigaev
12956db2b3 Fix small bug in headline generation.
Patch from Sushant Sinha <sushant354@gmail.com>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
2008-10-17 17:42:32 +00:00
Tom Lane
4a59796840 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.
2008-10-16 13:23:49 +00:00
Michael Meskes
f99df7c573 Optional argument should be optional. 2008-10-10 12:19:18 +00:00
Tom Lane
603ce02654 Fix overly tense optimization of PLpgSQL_func_hashkey: we must represent
the isTrigger state explicitly, not rely on nonzero-ness of trigrelOid
to indicate trigger-hood, because trigrelOid will be left zero when compiling
for validation.  The (useless) function hash entry built by the validator
was able to match an ordinary non-trigger call later in the same session,
thereby bypassing the check that is supposed to prevent such a call.
Per report from Alvaro.

It might be worth suppressing the useless hash entry altogether, but
that's a bigger change than I want to consider back-patching.

Back-patch to 8.0.  7.4 doesn't have the problem because it doesn't
have validation mode.
2008-10-09 16:35:33 +00:00
Tom Lane
cb0a4fed98 Fix improper display of fractional seconds in interval values
when using --enable-integer-datetimes and a non-ISO datestyle.

Ron Mayer
2008-10-02 13:48:03 +00:00
Tom Lane
c6b808ea8d Recent patches to pg_ctl broke "pg_ctl restart" for the case where no
command-line options had been given to the postmaster; and just plain
broke it altogether in 8.1 and 8.0.  Per report from KaiGai Kohei.
2008-09-30 13:14:28 +00:00
Marc G. Fournier
b0ea4828e4 tag for 8.0.18 2008-09-19 03:23:34 +00:00
Tom Lane
9ca010304d Update back-branch release notes. 2008-09-19 02:45:56 +00:00
Tom Lane
a763929571 Update time zone data files to tzdata release 2008f (DST law changes in
Argentina, Bahamas, Brazil, Mauritius, Morocco, Pakistan, Palestine, Paraguay).
2008-09-17 14:19:10 +00:00
Tom Lane
2b74fcedc4 Widen the nLocks counts in local lock tables from int to int64. This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)
2008-09-16 01:56:56 +00:00
Tom Lane
c1758175f8 Fix pg_dump docs to acknowledge that you can use -Z with plain text output. Pointed out by Daniel Migowski. 2008-08-26 00:03:43 +00:00
Tom Lane
af3f5293ef 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.
2008-08-16 02:25:30 +00:00
Tom Lane
1848ea7200 Install checks in executor startup to ensure that the tuples produced by an
INSERT or UPDATE will match the target table's current rowtype.  In pre-8.3
releases inconsistency can arise with stale cached plans, as reported by
Merlin Moncure.  (We patched the equivalent hazard on the SELECT side in Feb
2007; I'm not sure why we thought there was no risk on the insertion side.)
In 8.3 and HEAD this problem should be impossible due to plan cache
invalidation management, but it seems prudent to make the check anyway.

Back-patch as far as 8.0.  7.x versions lack ALTER COLUMN TYPE, so there
seems no way to abuse a stale plan comparably.
2008-08-08 17:01:41 +00:00
Tom Lane
7f75a64077 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.
2008-08-05 21:28:54 +00:00
Tom Lane
e126577aa0 Update 8.1 and 8.0 plpython to work with Python 2.5. This backports several
fixes made during the 8.2 development cycle, but not backported at the time
for lack of confidence in the new coding.

I didn't touch 7.4 because it has more problems than this: the configure
probe for Python fails.
2008-07-28 18:45:18 +00:00
Tom Lane
c54053355a 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.
2008-07-08 22:18:09 +00:00
Tom Lane
756aeaf0f3 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.
2008-07-07 20:25:30 +00:00
Tom Lane
2d94cf6bfe Fix identify_system_timezone() so that it tests the behavior of the system
timezone setting in the current year and for 100 years back, rather than
always examining years 1904-2004.  The original coding would have problems
distinguishing zones whose behavior diverged only after 2004; which is a
situation we will surely face sometime, if it's not out there already.

In passing, also prevent selection of the dummy "Factory" timezone, even
if that's exactly what the system is using.  Reporting time as GMT seems
better than that.
2008-07-01 03:41:25 +00:00
Bruce Momjian
0e69ff3399 Fix 'pg_ctl reload' to properly preserve postmaster commend-line
arguments on restart.  Patch to releases 8.0 - 8.3.X.
2008-06-27 01:52:58 +00:00
Tom Lane
bd80180e1d Clean up a number of bogosities around pltcl's handling of the Tcl "result":
1. Directly reading interp->result is deprecated in Tcl 8.0 and later;
you're supposed to use Tcl_GetStringResult.  This code finally broke with
Tcl 8.5, because Tcl_GetVar can now have side-effects on interp->result even
though it preserves the logical state of the result.  (There's arguably a
Tcl issue here, because Tcl_GetVar could invalidate the pointer result of a
just-preceding Tcl_GetStringResult, but I doubt the Tcl guys will see it as
a bug.)

2. We were being sloppy about the encoding of the result: some places would
push database-encoding data into the Tcl result, which should not happen,
and we were assuming that any error result coming back from Tcl was in the
database encoding, which is not a good assumption.

3. There were a lot of calls of Tcl_SetResult that uselessly specified
TCL_VOLATILE for constant strings.  This is only a minor performance issue,
but I fixed it in passing since I had to look at all the calls anyway.

#2 is a live bug regardless of which Tcl version you are interested in,
so back-patch even to branches that are unlikely to be used with Tcl 8.5.
I went back as far as 8.0, which is as far as the patch applied easily;
7.4 was using a different error processing scheme that has got its own
problems :-(
2008-06-17 00:53:13 +00:00
Tom Lane
4c2856c9b7 Create a script to handle stamping release version numbers into files,
replacing the tedious and error-prone manual process we've been using.
2008-06-10 18:09:15 +00:00
Tom Lane
d1290c5578 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.
2008-06-09 19:34:31 +00:00
Tom Lane
fdc891bec8 tag 8.0.17 2008-06-09 00:18:48 +00:00
Tom Lane
ee439b5242 Stamp 8.0.17 (except for configure.in/configure) 2008-06-08 22:15:07 +00:00
Tom Lane
1a7dadda5a Update release notes for 8.3.3 et al. 2008-06-07 22:11:25 +00:00
Tom Lane
0bb7588aee 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.
2008-06-06 18:00:00 +00:00
Tom Lane
5272652720 Remove link that pre-8.2 doc tools don't support. 2008-06-06 05:33:52 +00:00
Tom Lane
9525ec1a0f tag 8.0.16 2008-06-06 04:32:15 +00:00
Tom Lane
6a2cd0bfba Stamp 8.0.16 (except for configure.in/configure) 2008-06-05 23:56:24 +00:00
Tom Lane
8ea646bb68 Translation updates. 2008-06-05 23:37:32 +00:00
Tom Lane
0bb0f77d98 Draft release notes for upcoming back-branch updates. 2008-06-04 03:16:46 +00:00
Tom Lane
ca4dfc3c24 Update time zone data files to tzdata release 2008c (DST law changes in
Morocco, Iraq, Choibalsan, Pakistan, Syria, Cuba, Argentina/San_Luis).
2008-06-01 18:23:30 +00:00