1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

17225 Commits

Author SHA1 Message Date
Tom Lane
dbb6d2f959 Update back-branch release notes. 2009-03-12 22:36:46 +00:00
Tom Lane
aff86a81b5 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.
2009-03-12 00:54:04 +00:00
Heikki Linnakangas
cb5a81b546 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
2009-03-05 14:29:26 +00:00
Tom Lane
4c13245896 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.
2009-03-04 22:08:53 +00:00
Tom Lane
80be60530f 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.
2009-03-03 00:17:44 +00:00
Tom Lane
1f3832b5d2 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.
2009-03-02 21:19:23 +00:00
Tom Lane
5156266ab6 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.
2009-02-28 18:50:25 +00:00
Heikki Linnakangas
17485e504d 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.
2009-02-27 16:35:53 +00:00
Marc G. Fournier
cedefbdf13 tag 7.4.24 REL7_4_24 2009-01-30 03:54:33 +00:00
Tom Lane
fc39a00022 Update back-branch release notes. 2009-01-30 00:38:26 +00:00
Peter Eisentraut
ef8074d892 Translation updates 2009-01-29 22:02:17 +00:00
Tom Lane
20112509bc 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:15 +00:00
Magnus Hagander
d8b324ebd8 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:48 +00:00
Teodor Sigaev
d01bcba483 Fix uninitialized variables in get_covers 2009-01-16 12:10:34 +00:00
Teodor Sigaev
e0408ba3d5 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:30:10 +00:00
Teodor Sigaev
f58cccb0b5 Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
2009-01-15 18:29:47 +00:00
Alvaro Herrera
b379d53c30 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.
2009-01-13 15:28:42 +00:00
Tom Lane
e3a4d5cf8c 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:15 +00:00
Heikki Linnakangas
4d79a50494 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:13 +00:00
Marc G. Fournier
31f6cfb690 tag 7.4.23 REL7_4_23 2008-10-31 03:15:21 +00:00
Tom Lane
ef15b87f45 Update back-branch release notes. 2008-10-30 22:23:39 +00:00
Peter Eisentraut
3b5767cba7 Translation updates 2008-10-30 19:19:35 +00:00
Tom Lane
771374b34b 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:56 +00:00
Teodor Sigaev
ca2ecbdaca 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:44:15 +00:00
Tom Lane
6b969fa8af 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:57 +00:00
Michael Meskes
74f7c8e4d6 Optional argument should be optional. 2008-10-10 12:19:03 +00:00
Tom Lane
c15b9a505d 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:12 +00:00
Marc G. Fournier
b304b8640b tag for 7.4.22 REL7_4_22 2008-09-19 03:30:27 +00:00
Tom Lane
ff1c15e020 Update back-branch release notes. 2008-09-19 02:46:08 +00:00
Tom Lane
d32b17a5fd 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:52 +00:00
Tom Lane
7eb9f613c3 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:38 +00:00
Tom Lane
45b8e6ed68 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:29:01 +00:00
Tom Lane
20c20dfeec 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:18 +00:00
Tom Lane
99772d6465 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:40 +00:00
Tom Lane
2e09f53ed3 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:26 +00:00
Tom Lane
0c423f0258 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:40 +00:00
Tom Lane
9acedf8faf tag 7.4.21 REL7_4_21 2008-06-09 00:16:58 +00:00
Tom Lane
33266e0716 Stamp 7.4.21 (except for configure.in/configure) 2008-06-08 22:15:45 +00:00
Tom Lane
ad17600267 Update release notes for 8.3.3 et al. 2008-06-07 22:11:40 +00:00
Tom Lane
c760d70af4 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:09 +00:00
Tom Lane
bef81252ca Remove link that pre-8.2 doc tools don't support. REL7_4_20 2008-06-06 05:34:03 +00:00
Tom Lane
c2e3599105 tag 7.4.20 2008-06-06 04:37:07 +00:00
Tom Lane
fd3a83436a Stamp 7.4.20 (except for configure.in/configure) 2008-06-05 23:56:42 +00:00
Tom Lane
ad37d9e46a Translation updates. 2008-06-05 23:38:03 +00:00
Tom Lane
9245557602 Draft release notes for upcoming back-branch updates. 2008-06-04 03:17:01 +00:00
Tom Lane
8b0d5949a8 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.
2008-05-28 00:46:12 +00:00
Tom Lane
c59eef17c9 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.
2008-05-27 21:14:00 +00:00
Tom Lane
ea28271165 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.
2008-05-25 21:51:38 +00:00
Magnus Hagander
7cff884c38 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
2008-05-13 20:53:54 +00:00
Tom Lane
7baef60c8b 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.
2008-05-09 22:38:05 +00:00