]> git.ipfire.org Git - thirdparty/postgresql.git/log
thirdparty/postgresql.git
18 years agoMinor copy-editing for release note updates.
Tom Lane [Fri, 5 Jan 2007 22:35:04 +0000 (22:35 +0000)] 
Minor copy-editing for release note updates.

18 years agoStamp release 8.0.10.
Bruce Momjian [Fri, 5 Jan 2007 20:53:30 +0000 (20:53 +0000)] 
Stamp release 8.0.10.

18 years agoCreate release notes for 8.0.10.
Bruce Momjian [Fri, 5 Jan 2007 20:03:19 +0000 (20:03 +0000)] 
Create release notes for 8.0.10.

18 years agoFix regex_fixed_prefix() to cope reasonably well with regex patterns of the
Tom Lane [Wed, 3 Jan 2007 22:39:49 +0000 (22:39 +0000)] 
Fix regex_fixed_prefix() to cope reasonably well with regex patterns of the
form '^(foo)$'.  Before, these could never be optimized into indexscans.
The recent changes to make psql and pg_dump generate such patterns (for \d
commands and -t and related switches, respectively) therefore represented
a big performance hit for people with large pg_class catalogs, as seen in
recent gripe from Erik Jones.  While at it, be more paranoid about
case-sensitivity checking in multibyte encodings, and fix some other
corner cases in which a regex might be interpreted too liberally.

18 years agoRepair bug #2839: the various ExecReScan functions need to reset
Tom Lane [Tue, 26 Dec 2006 19:27:10 +0000 (19:27 +0000)] 
Repair bug #2839: the various ExecReScan functions need to reset
ps_TupFromTlist in plan nodes that make use of it.  This was being done
correctly in join nodes and Result nodes but not in any relation-scan nodes.
Bug would lead to bogus results if a set-returning function appeared in the
targetlist of a subquery that could be rescanned after partial execution,
for example a subquery within EXISTS().  Bug has been around forever :-(
... surprising it wasn't reported before.

18 years agoFix convertion for 'PFX flag N num'
Teodor Sigaev [Thu, 21 Dec 2006 17:36:08 +0000 (17:36 +0000)] 
Fix convertion for 'PFX flag N num'

18 years agoDocument the recently-understood hazard that a rollback can release row-level
Tom Lane [Fri, 1 Dec 2006 20:50:06 +0000 (20:50 +0000)] 
Document the recently-understood hazard that a rollback can release row-level
locks that logically should not be released, because when a subtransaction
overwrites XMAX all knowledge of the previous lock state is lost.  It seems
unlikely that we will be able to fix this before 8.3...

18 years agoUpdate timezone data to tzdata2006p zic distribution. It seems Western
Tom Lane [Tue, 28 Nov 2006 19:37:23 +0000 (19:37 +0000)] 
Update timezone data to tzdata2006p zic distribution.  It seems Western
Australia decided to institute DST with one month's notice ... way to go,
politicians.

18 years agoMark to_number() and the numeric-type variants of to_char() as stable, not
Tom Lane [Tue, 28 Nov 2006 19:19:07 +0000 (19:19 +0000)] 
Mark to_number() and the numeric-type variants of to_char() as stable, not
immutable, because their results depend on lc_numeric; this is a longstanding
oversight.  We cannot force initdb for this in the back branches, but we can
at least provide correct catalog entries for future installations.

18 years agoFix psql's \copy command to ensure that it cycles libpq back to the idle state
Tom Lane [Fri, 24 Nov 2006 23:07:01 +0000 (23:07 +0000)] 
Fix psql's \copy command to ensure that it cycles libpq back to the idle state
(in particular, causing the ReadyForQuery message to be eaten) before
returning from do_copy.  The only known consequence of failing to do so is
that get_prompt might show a wrong result for the %x transaction status
escape, as reported by Bernd Helmle; but it's possible there are other issues.

Back-patch as far as 7.4, the oldest version supporting %x.

18 years agoFix 1-byte buffer overrun when OID exceeds 1 billion. This probably can't
Tom Lane [Wed, 22 Nov 2006 21:13:04 +0000 (21:13 +0000)] 
Fix 1-byte buffer overrun when OID exceeds 1 billion.  This probably can't
cause any serious harm in normal cases, but if you have gcc buffer overrun
checking turned on, that will notice.  Found by Jack Orenstein.  Problem
was already fixed in CVS HEAD.

18 years agoWhen truncating a relation in-place (eg during VACUUM), do not try to unlink
Tom Lane [Mon, 20 Nov 2006 01:08:10 +0000 (01:08 +0000)] 
When truncating a relation in-place (eg during VACUUM), do not try to unlink
any no-longer-needed segments; just truncate them to zero bytes and leave
the files in place for possible future re-use.  This avoids problems when
the segments are re-used due to relation growth shortly after truncation.
Before, the bgwriter, and possibly other backends, could still be holding
open file references to the old segment files, and would write dirty blocks
into those files where they'd disappear from the view of other processes.

Back-patch as far as 8.0.  I believe the 7.x branches are not vulnerable,
because they had no bgwriter, and "blind" writes by other backends would
always be done via freshly-opened file references.

18 years agoRepair problems with hash indexes that span multiple segments: the hash code's
Tom Lane [Sun, 19 Nov 2006 21:33:37 +0000 (21:33 +0000)] 
Repair problems with hash indexes that span multiple segments: the hash code's
preference for filling pages out-of-order tends to confuse the sanity checks
in md.c, as per report from Balazs Nagy in bug #2737.  The fix is to ensure
that the smgr-level code always has the same idea of the logical EOF as the
hash index code does, by using ReadBuffer(P_NEW) where we are adding a single
page to the end of the index, and using smgrextend() to reserve a large batch
of pages when creating a new splitpoint.  The patch is a bit ugly because it
avoids making any changes in md.c, which seems the most prudent approach for a
backpatchable beta-period fix.  After 8.3 development opens, I'll take a look
at a cleaner but more invasive patch, in particular getting rid of the now
unnecessary hack to allow reading beyond EOF in mdread().

Backpatch as far as 7.4.  The bug likely exists in 7.3 as well, but because
of the magnitude of the 7.3-to-7.4 changes in hash, the later-version patch
doesn't even begin to apply.  Given the other known bugs in the 7.3-era hash
code, it does not seem worth trying to develop a separate patch for 7.3.

18 years agoApplied patch by Peter Harris to free auto_mem struct in ECPGconnect.
Michael Meskes [Wed, 8 Nov 2006 10:48:21 +0000 (10:48 +0000)] 
Applied patch by Peter Harris to free auto_mem struct in ECPGconnect.

18 years agoRepair bug #2694 concerning an ARRAY[] construct whose inputs are empty
Tom Lane [Mon, 6 Nov 2006 18:21:47 +0000 (18:21 +0000)] 
Repair bug #2694 concerning an ARRAY[] construct whose inputs are empty
sub-arrays.  Per discussion, if all inputs are empty arrays then result
must be an empty array too, whereas a mix of empty and nonempty arrays
should (and already did) draw an error.  In the back branches, the
construct was strict: any NULL input immediately yielded a NULL output;
so I left that behavior alone.  HEAD was simply ignoring NULL sub-arrays,
which doesn't seem very sensible.  For lack of a better idea it now
treats NULL sub-arrays the same as empty ones.

18 years agoFix "failed to re-find parent key" btree VACUUM failure by tweaking
Tom Lane [Wed, 1 Nov 2006 19:50:08 +0000 (19:50 +0000)] 
Fix "failed to re-find parent key" btree VACUUM failure by tweaking
_bt_pagedel to recover from the failure: just search the whole parent level
if searching to the right fails.  This does nothing for the underlying problem
that index keys became out-of-order in the grandparent level.  However, we
believe that there is no other consequence worse than slightly inefficient
searching, so this narrow patch seems like the safest solution for the back
branches.

18 years agoBack-patch second version of AIX getaddrinfo fix.
Tom Lane [Fri, 20 Oct 2006 01:10:35 +0000 (01:10 +0000)] 
Back-patch second version of AIX getaddrinfo fix.

18 years agoWork around reported problem that AIX's getaddrinfo() doesn't seem to zero
Tom Lane [Thu, 19 Oct 2006 17:26:43 +0000 (17:26 +0000)] 
Work around reported problem that AIX's getaddrinfo() doesn't seem to zero
sin_port in the returned IP address struct when servname is NULL.  This has
been observed to cause failure to bind the stats collection socket, and
could perhaps cause other issues too.  Per reports from Brad Nicholson
and Chris Browne.

18 years agoFix infinite sleep and failes of send in Win32.
Teodor Sigaev [Fri, 13 Oct 2006 14:00:41 +0000 (14:00 +0000)] 
Fix infinite sleep and failes of send in Win32.

1) pgwin32_waitforsinglesocket(): WaitForMultipleObjectsEx now called with
finite timeout (100ms) in case of FP_WRITE and UDP socket. If timeout occurs
then pgwin32_waitforsinglesocket() tries to write empty packet goes to
WaitForMultipleObjectsEx again.

2) pgwin32_send(): add loop around WSASend and pgwin32_waitforsinglesocket().
The reason is: for overlapped socket, 'ok' result from
pgwin32_waitforsinglesocket() isn't guarantee that socket is still free,
it can become busy again and following WSASend call will fail with
WSAEWOULDBLOCK error.

See http://archives.postgresql.org/pgsql-hackers/2006-10/msg00561.php

18 years agoStamp 8.0.9. REL8_0_9
Tom Lane [Thu, 12 Oct 2006 19:41:43 +0000 (19:41 +0000)] 
Stamp 8.0.9.

18 years agoUpdate release notes for SQL functions vs triggers fix.
Tom Lane [Thu, 12 Oct 2006 19:25:32 +0000 (19:25 +0000)] 
Update release notes for SQL functions vs triggers fix.

18 years agoFix mishandling of after-trigger state when a SQL function returns multiple
Tom Lane [Thu, 12 Oct 2006 17:02:34 +0000 (17:02 +0000)] 
Fix mishandling of after-trigger state when a SQL function returns multiple
rows --- if the surrounding query queued any trigger events between the rows,
the events would be fired at the wrong time, leading to bizarre behavior.
Per report from Merlin Moncure.

This is a simple patch that should solve the problem fully in the back
branches, but in HEAD we also need to consider the possibility of queries
with RETURNING clauses.  Will look into a fix for that separately.

18 years agoA bit of copy-editing on back-branch release notes.
Tom Lane [Wed, 11 Oct 2006 20:56:10 +0000 (20:56 +0000)] 
A bit of copy-editing on back-branch release notes.

18 years agoRepair incorrect check for coercion of unknown literal to ANYARRAY, a bug
Tom Lane [Wed, 11 Oct 2006 20:21:19 +0000 (20:21 +0000)] 
Repair incorrect check for coercion of unknown literal to ANYARRAY, a bug
I introduced in 7.4.1 :-(.  It's correct to allow unknown to be coerced to
ANY or ANYELEMENT, since it's a real-enough data type, but it most certainly
isn't an array datatype.  This can cause a backend crash but AFAICT is not
exploitable as a security hole.  Per report from Michael Fuhr.

Note: as fixed in HEAD, this changes a constant in the pg_stats view,
resulting in a change in the expected regression outputs.  The back-branch
patches have been hacked to avoid that, so that pre-existing installations
won't start failing their regression tests.

18 years agoCREATE TABLE ... LIKE ... should mark the columns it creates with
Tom Lane [Wed, 11 Oct 2006 20:03:18 +0000 (20:03 +0000)] 
CREATE TABLE ... LIKE ... should mark the columns it creates with
attislocal = true, since they are not really inherited but merely copied
from the original table.  I'm not sure if there are any cases where it makes
a real difference given the existing uses of the flag, but wrong is wrong.
This was fixed in passing in HEAD by the LIKE INCLUDING CONSTRAINTS patch,
but never back-patched.

18 years agoFix psql \d commands to behave properly when a pattern using regex | is given.
Tom Lane [Tue, 10 Oct 2006 16:15:28 +0000 (16:15 +0000)] 
Fix psql \d commands to behave properly when a pattern using regex | is given.
Formerly they'd emit '^foo|bar$' which is wrong because the anchors are
parsed as part of the alternatives; must emit '^(foo|bar)$' to get expected
behavior.  Same as bug found previously in similar_escape().  Already fixed
in HEAD, this is just back-porting the part of that patch that was a bug fix.

18 years agoStamp releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5.
Bruce Momjian [Mon, 9 Oct 2006 23:38:46 +0000 (23:38 +0000)] 
Stamp releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5.

18 years agoUpdate release notes for releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5.
Bruce Momjian [Mon, 9 Oct 2006 23:23:29 +0000 (23:23 +0000)] 
Update release notes for releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5.

18 years agoFix back-branch pg_regress scripts to try the "canonical" expected file if we
Tom Lane [Mon, 9 Oct 2006 01:45:49 +0000 (01:45 +0000)] 
Fix back-branch pg_regress scripts to try the "canonical" expected file if we
tried a variant file from resultmap and it didn't match.  This is already done
in HEAD's C-code version, and is needed because OpenBSD has recently migrated
to a more standard handling of float underflow --- see buildfarm results
from emu.

18 years agoFix ancient oversight in psql's \d pattern processing code: when seeing two
Tom Lane [Sat, 7 Oct 2006 22:21:50 +0000 (22:21 +0000)] 
Fix ancient oversight in psql's \d pattern processing code: when seeing two
quote chars inside quote marks, should emit one quote *and stay in inquotes
mode*.  No doubt the lack of reports of this have something to do with the
poor documentation of the feature ...

18 years agoFix string_to_array() to correctly handle the case where there are
Tom Lane [Sat, 7 Oct 2006 00:12:05 +0000 (00:12 +0000)] 
Fix string_to_array() to correctly handle the case where there are
overlapping possible matches for the separator string, such as
string_to_array('123xx456xxx789', 'xx').
Also, revise the logic of replace(), split_part(), and string_to_array()
to avoid O(N^2) work from redundant searches and conversions to pg_wchar
format when there are N matches to the separator string.
Backpatched the full patch as far as 8.0.  7.4 also has the bug, but the
code has diverged a lot, so I just went for a quick-and-dirty fix of the
bug itself in that branch.

18 years agoFix SysCacheGetAttr() to handle the case where the specified syscache has not
Tom Lane [Fri, 6 Oct 2006 18:23:48 +0000 (18:23 +0000)] 
Fix SysCacheGetAttr() to handle the case where the specified syscache has not
been initialized yet.  This can happen because there are code paths that call
SysCacheGetAttr() on a tuple originally fetched from a different syscache
(hopefully on the same catalog) than the one specified in the call.  It
doesn't seem useful or robust to try to prevent that from happening, so just
improve the function to cope instead.  Per bug#2678 from Jeff Trout.  The
specific example shown by Jeff is new in 8.1, but to be on the safe side
I'm backpatching 8.0 as well.  We could patch 7.x similarly but I think
that's probably overkill, given the lack of evidence of old bugs of this ilk.

18 years agodate_trunc also accepts 'quarter'. Noted by Yoshihisa Nakano.
Tom Lane [Sun, 1 Oct 2006 18:54:48 +0000 (18:54 +0000)] 
date_trunc also accepts 'quarter'.  Noted by Yoshihisa Nakano.

18 years agoClean up rather sloppy fix in HEAD for the ancient bug that CREATE CONVERSION
Tom Lane [Thu, 31 Aug 2006 17:31:48 +0000 (17:31 +0000)] 
Clean up rather sloppy fix in HEAD for the ancient bug that CREATE CONVERSION
didn't create a dependency from the new conversion to its schema.  Back-patch
to all supported releases.

18 years agoFix mistyping
Teodor Sigaev [Tue, 29 Aug 2006 15:49:00 +0000 (15:49 +0000)] 
Fix mistyping

18 years agoAdd installcheck-parallel target to top level makefiles.
Andrew Dunstan [Fri, 18 Aug 2006 19:59:05 +0000 (19:59 +0000)] 
Add installcheck-parallel target to top level makefiles.

18 years agoBackported buffer overrun fix from HEAD
Michael Meskes [Fri, 18 Aug 2006 16:33:50 +0000 (16:33 +0000)] 
Backported buffer overrun fix from HEAD

18 years agoApplied the connect patch from HEAD
Michael Meskes [Fri, 18 Aug 2006 16:00:49 +0000 (16:00 +0000)] 
Applied the connect patch from HEAD

18 years agoFix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime...
Teodor Sigaev [Tue, 8 Aug 2006 15:45:56 +0000 (15:45 +0000)] 
Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com>

18 years agoBack-port HEAD's configure fixes to select appropriate compiler switches
Tom Lane [Mon, 7 Aug 2006 20:08:57 +0000 (20:08 +0000)] 
Back-port HEAD's configure fixes to select appropriate compiler switches
for Intel's icc and AIX's xlc.

18 years agofix bug about modifying value in shared buffer,
Teodor Sigaev [Mon, 7 Aug 2006 17:40:53 +0000 (17:40 +0000)] 
fix bug about modifying value in shared buffer,
what was a reason to corrupt index.
Thank to Mario Weilguni <mweilguni@sime.com> to
discover a bug.

18 years agoFix confusion between COPY FROM and COPY TO, per Gavin Sharry and Arul Shaji.
Alvaro Herrera [Mon, 31 Jul 2006 01:09:48 +0000 (01:09 +0000)] 
Fix confusion between COPY FROM and COPY TO, per Gavin Sharry and Arul Shaji.

18 years agoprevent multiplexing Windows kernel event objects we listen for across various socket...
Andrew Dunstan [Sat, 29 Jul 2006 20:14:40 +0000 (20:14 +0000)] 
prevent multiplexing Windows kernel event objects we listen for across various sockets - should fix the occasional stats test regression failures we see.

19 years agoEnsure that we retry rather than erroring out when send() or recv() return
Tom Lane [Sun, 16 Jul 2006 18:17:35 +0000 (18:17 +0000)] 
Ensure that we retry rather than erroring out when send() or recv() return
EINTR; the stats code was failing to do this and so were a couple of places
in the postmaster.  The stats code assumed that recv() could not return EINTR
if a preceding select() showed the socket to be read-ready, but this is
demonstrably false with our Windows implementation of recv(), and it may
not be the case on all Unix variants either.  I think this explains the
intermittent stats regression test failures we've been seeing, as well
as reports of stats collector instability under high load on Windows.

Backpatch as far as 8.0.

19 years agoAdd dependency to fix parallel-make race condition. Alexander Dupuy
Tom Lane [Fri, 14 Jul 2006 16:45:55 +0000 (16:45 +0000)] 
Add dependency to fix parallel-make race condition.  Alexander Dupuy

19 years agoFix bug corrupting query in gist consistent function.
Teodor Sigaev [Tue, 11 Jul 2006 16:06:40 +0000 (16:06 +0000)] 
Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.

19 years agoFix ALTER TABLE to check pre-existing NOT NULL constraints when rewriting
Tom Lane [Mon, 10 Jul 2006 22:10:57 +0000 (22:10 +0000)] 
Fix ALTER TABLE to check pre-existing NOT NULL constraints when rewriting
a table.  Otherwise a USING clause that yields NULL can leave the table
violating its constraint (possibly there are other cases too).  Per report
from Alexander Pravking.

19 years agoFix dbmirror for new backslash escaping:
Bruce Momjian [Thu, 6 Jul 2006 02:03:00 +0000 (02:03 +0000)] 
Fix dbmirror for new backslash escaping:

Martin Pitt [2006-06-16  0:15 +0200]:
> Upstream confirmed my reply in the last mail in [1]: the complete
> escaping logic in DBMirror.pl is seriously screwew.
>
> [1] http://archives.postgresql.org/pgsql-bugs/2006-06/msg00065.php

I finally found some time to debug this, and I think I found a better
patch than the one you proposed. Mine is still hackish and is still a
workaround around a proper quoting solution, but at least it repairs
the parsing without introducing the \' quoting again.

I consider this a band-aid patch to fix the recent security update.
PostgreSQL gurus, would you consider applying this until a better
solution is found for DBMirror.pl?

Martin Pitt        http://www.piware.de

19 years agoFixed remaining Coverity bugs.
Michael Meskes [Wed, 5 Jul 2006 10:50:20 +0000 (10:50 +0000)] 
Fixed remaining Coverity bugs.

19 years agoAdded missing braces to prevent a segfault after usage of an undeclared cursor.
Michael Meskes [Mon, 26 Jun 2006 14:13:04 +0000 (14:13 +0000)] 
Added missing braces to prevent a segfault after usage of an undeclared cursor.

19 years agoAdded some more coverity report patches send in by Joachim Wieland <joe@mcknight...
Michael Meskes [Mon, 26 Jun 2006 09:20:30 +0000 (09:20 +0000)] 
Added some more coverity report patches send in by Joachim Wieland <joe@mcknight.de>.

19 years agoMoved some free() calls that coverity correctly complains about.
Michael Meskes [Sun, 25 Jun 2006 10:00:11 +0000 (10:00 +0000)] 
Moved some free() calls that coverity correctly complains about.

19 years agoOur version of getopt_long does not set optarg upon detecting an error, as
Alvaro Herrera [Sun, 25 Jun 2006 04:38:08 +0000 (04:38 +0000)] 
Our version of getopt_long does not set optarg upon detecting an error, as
opposed to what other versions apparently do, so it's not safe to print an
error message.  Besides, getopt_long itself already did, so it's redundant
anyway.

19 years agoAdded some more coverity report patches send in by Martijn van Oosterhout <kleptog...
Michael Meskes [Wed, 21 Jun 2006 11:38:35 +0000 (11:38 +0000)] 
Added some more coverity report patches send in by Martijn van Oosterhout <kleptog@svana.org>.

19 years agoAdded fixes from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Michael Meskes [Wed, 21 Jun 2006 10:31:45 +0000 (10:31 +0000)] 
Added fixes from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Added missing error handling in a few functions in ecpglib.

19 years agoBack-port shell script syntax fix needed for some BSD machines.
Tom Lane [Mon, 19 Jun 2006 14:25:01 +0000 (14:25 +0000)] 
Back-port shell script syntax fix needed for some BSD machines.
Per buildfarm results from spoonbill.

19 years agoDo not use already free'ed errmsg, bug found by Joachim Wieland
Michael Meskes [Mon, 19 Jun 2006 09:20:22 +0000 (09:20 +0000)] 
Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>

19 years agoIncrease timeout in statement_timeout test from 1 second to 2 seconds.
Tom Lane [Sun, 18 Jun 2006 16:21:40 +0000 (16:21 +0000)] 
Increase timeout in statement_timeout test from 1 second to 2 seconds.
We have once or twice seen failures suggesting that control didn't get
to the exception block before the timeout elapsed, which is unlikely
but not impossible in a parallel regression test (with a dozen other
backends competing for cycles).  This change doesn't completely prevent
the problem of course, but it should reduce the probability enough that
we don't see it anymore.  Per buildfarm results.

19 years agobackport workaround for OpenBSD compiler bug
Andrew Dunstan [Sat, 17 Jun 2006 14:50:44 +0000 (14:50 +0000)] 
backport workaround for OpenBSD compiler bug

19 years agoFix Assert failure when a fastpath function call is attempted inside an
Tom Lane [Sun, 11 Jun 2006 15:49:46 +0000 (15:49 +0000)] 
Fix Assert failure when a fastpath function call is attempted inside an
already-aborted transaction block.  GetSnapshotData throws an Assert if
not in a valid transaction; hence we mustn't attempt to set a snapshot
for the function until after checking for aborted transaction.  This is
harmless AFAICT if Asserts aren't enabled (GetSnapshotData will compute
a bogus snapshot, but it doesn't matter since HandleFunctionRequest will
throw an error shortly anywy).  Hence, not a major bug.

Along the way, add some ability to log fastpath calls when statement
logging is turned on.  This could probably stand to be improved further,
but not logging anything is clearly undesirable.

Backpatched as far as 8.0; bug doesn't exist before that.

19 years agoFixed two memory leaks in ecpglib.
Michael Meskes [Tue, 6 Jun 2006 11:36:12 +0000 (11:36 +0000)] 
Fixed two memory leaks in ecpglib.

19 years agoFix copy-and-pasteo in Russian translation: message complaining about
Tom Lane [Sat, 3 Jun 2006 16:49:32 +0000 (16:49 +0000)] 
Fix copy-and-pasteo in Russian translation: message complaining about
HAVE_INT64_TIMESTAMP was mentioning PG_CONTROL_VERSION instead.
Victor Snezhko

19 years agoBack-port recent ppport.h fix to 8.0 branch.
Tom Lane [Thu, 1 Jun 2006 03:47:34 +0000 (03:47 +0000)] 
Back-port recent ppport.h fix to 8.0 branch.

19 years agoRemove pqsignalinquire(), which is unused and has portability issues.
Tom Lane [Tue, 30 May 2006 15:58:14 +0000 (15:58 +0000)] 
Remove pqsignalinquire(), which is unused and has portability issues.

19 years agoKlugy fix for bug #2447: we can't expand a whole-row reference to NEW
Tom Lane [Tue, 23 May 2006 17:09:18 +0000 (17:09 +0000)] 
Klugy fix for bug #2447: we can't expand a whole-row reference to NEW
in a rule WHERE expression while inserting it into the original query,
because the 8.0 ResolveNew API is wrongly designed.  This is fixed in 8.1
but I'm disinclined to risk back-porting the changes.  Instead, just stop
the coredump and instead issue the same 'cannot handle whole-row reference'
message that 7.4 and before generated in this situation.

19 years agoStamp release 8.0.8. REL8_0_8
Tom Lane [Sun, 21 May 2006 21:53:31 +0000 (21:53 +0000)] 
Stamp release 8.0.8.

19 years agoUpdate release notes for upcoming releases.
Tom Lane [Sun, 21 May 2006 21:49:50 +0000 (21:49 +0000)] 
Update release notes for upcoming releases.

19 years agoFix missed \' to '' conversion.
Tom Lane [Sun, 21 May 2006 21:13:50 +0000 (21:13 +0000)] 
Fix missed \' to '' conversion.

19 years agoStamp releases 7.3.15, 7.4.13, and 8.0.8.
Bruce Momjian [Sun, 21 May 2006 20:28:35 +0000 (20:28 +0000)] 
Stamp releases 7.3.15, 7.4.13, and 8.0.8.

19 years agoModify libpq's string-escaping routines to be aware of encoding considerations
Tom Lane [Sun, 21 May 2006 20:20:05 +0000 (20:20 +0000)] 
Modify libpq's string-escaping routines to be aware of encoding considerations
and standard_conforming_strings.  The encoding changes are needed for proper
escaping in multibyte encodings, as per the SQL-injection vulnerabilities
noted in CVE-2006-2313 and CVE-2006-2314.  Concurrent fixes are being applied
to the server to ensure that it rejects queries that may have been corrupted
by attempted SQL injection, but this merely guarantees that unpatched clients
will fail rather than allow injection.  An actual fix requires changing the
client-side code.  While at it we have also fixed these routines to understand
about standard_conforming_strings, so that the upcoming changeover to SQL-spec
string syntax can be somewhat transparent to client code.

Since the existing API of PQescapeString and PQescapeBytea provides no way to
inform them which settings are in use, these functions are now deprecated in
favor of new functions PQescapeStringConn and PQescapeByteaConn.  The new
functions take the PGconn to which the string will be sent as an additional
parameter, and look inside the connection structure to determine what to do.
So as to provide some functionality for clients using the old functions,
libpq stores the latest encoding and standard_conforming_strings values
received from the backend in static variables, and the old functions consult
these variables.  This will work reliably in clients using only one Postgres
connection at a time, or even multiple connections if they all use the same
encoding and string syntax settings; which should cover many practical
scenarios.

Clients that use homebrew escaping methods, such as PHP's addslashes()
function or even hardwired regexp substitution, will require extra effort
to fix :-(.  It is strongly recommended that such code be replaced by use of
PQescapeStringConn/PQescapeByteaConn if at all feasible.

19 years agoAdd a new GUC parameter backslash_quote, which determines whether the SQL
Tom Lane [Sun, 21 May 2006 20:11:25 +0000 (20:11 +0000)] 
Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.

19 years agoChange the backend to reject strings containing invalidly-encoded multibyte
Tom Lane [Sun, 21 May 2006 20:06:18 +0000 (20:06 +0000)] 
Change the backend to reject strings containing invalidly-encoded multibyte
characters in all cases.  Formerly we mostly just threw warnings for invalid
input, and failed to detect it at all if no encoding conversion was required.
The tighter check is needed to defend against SQL-injection attacks as per
CVE-2006-2313 (further details will be published after release).  Embedded
zero (null) bytes will be rejected as well.  The checks are applied during
input to the backend (receipt from client or COPY IN), so it no longer seems
necessary to check in textin() and related routines; any string arriving at
those functions will already have been validated.  Conversion failure
reporting (for characters with no equivalent in the destination encoding)
has been cleaned up and made consistent while at it.

Also, fix a few longstanding errors in little-used encoding conversion
routines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic,
mic_to_euc_tw were all broken to varying extents.

Patches by Tatsuo Ishii and Tom Lane.  Thanks to Akio Ishida and Yasuo Ohgaki
for identifying the security issues.

19 years agoChange \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
Bruce Momjian [Sun, 21 May 2006 19:57:40 +0000 (19:57 +0000)] 
Change \' to '', for SQL standards compliance.  Backpatch to 7.3, 7.4,
and 8.0.  Later releases already patched.

19 years agoFix nasty bug in nodeIndexscan.c's detection of duplicate tuples during
Tom Lane [Fri, 19 May 2006 16:30:50 +0000 (16:30 +0000)] 
Fix nasty bug in nodeIndexscan.c's detection of duplicate tuples during
a multiple (OR'ed) indexscan.  It was checking for duplicate
tuple->t_data->t_ctid, when what it should be checking is tuple->t_self.
The trouble situation occurs when a live tuple has t_ctid not pointing to
itself, which can happen if an attempted UPDATE was rolled back.  After a
VACUUM, an unrelated tuple could be installed where the failed update tuple
was, leading to one live tuple's t_ctid pointing to an unrelated tuple.
If one of these tuples is fetched by an earlier OR'ed indexscan and the other
by a later indexscan, nodeIndexscan.c would incorrectly ignore the second
tuple.  The bug exists in all 7.4.* and 8.0.* versions, but not in earlier
or later branches because this code was only used in those releases.  Per
trouble report from Rafael Martinez Guerrero.

19 years agoFix the sense of the test on DH_check()'s return value. This was preventing
Tom Lane [Fri, 12 May 2006 22:44:50 +0000 (22:44 +0000)] 
Fix the sense of the test on DH_check()'s return value.  This was preventing
custom-generated DH parameters from actually being used by the server.
Found by Michael Fuhr.

19 years agoRemove unnecessary .seg/.section directives, per Alan Stange.
Tom Lane [Thu, 11 May 2006 21:58:37 +0000 (21:58 +0000)] 
Remove unnecessary .seg/.section directives, per Alan Stange.

19 years agoBuild server libpgport with all non-FRONTEND object files. This is to
Bruce Momjian [Mon, 8 May 2006 02:18:21 +0000 (02:18 +0000)] 
Build server libpgport with all non-FRONTEND object files.  This is to
fix a Win32 bug where pipe.c included a file that used FRONTEND, but it
wasn't on the server-build list.

19 years agoFix SELECT INTO and CREATE TABLE AS to create tables in the default
Bruce Momjian [Wed, 26 Apr 2006 23:01:13 +0000 (23:01 +0000)] 
Fix SELECT INTO and CREATE TABLE AS to create tables in the default
tablespace, not the base directory.

Kris Jurka

19 years agoFixed memory leak bugs found by Martijn Oosterhout.
Michael Meskes [Mon, 24 Apr 2006 09:45:57 +0000 (09:45 +0000)] 
Fixed memory leak bugs found by Martijn Oosterhout.

19 years agoFix ancient memory leak in PQprintTuples(); our code no longer uses this
Tom Lane [Wed, 19 Apr 2006 16:15:41 +0000 (16:15 +0000)] 
Fix ancient memory leak in PQprintTuples(); our code no longer uses this
routine, but perhaps some applications do.  Found by Martijn van Oosterhout
using Coverity.

19 years agoFix similar_escape() so that SIMILAR TO works properly for patterns involving
Tom Lane [Thu, 13 Apr 2006 18:01:45 +0000 (18:01 +0000)] 
Fix similar_escape() so that SIMILAR TO works properly for patterns involving
alternatives ("|" symbol).  The original coding allowed the added ^ and $
constraints to be absorbed into the first and last alternatives, producing
a pattern that would match more than it should.  Per report from Eric Noriega.

I also changed the pattern to add an ARE director ("***:"), ensuring that
SIMILAR TO patterns do not change behavior if regex_flavor is changed.  This
is necessary to make the non-capturing parentheses work, and seems like a
good idea on general principles.

Back-patched as far as 7.4.  7.3 also has the bug, but a fix seems impractical
because that version's regex engine doesn't have non-capturing parens.

19 years agoDetoast query in g_intbig_consistent and copy query in g_int_consistent.
Teodor Sigaev [Mon, 3 Apr 2006 10:45:28 +0000 (10:45 +0000)] 
Detoast query in g_intbig_consistent and copy query in g_int_consistent.
Minor cleanups.

19 years agoTablespaceCreateDbspace should function normally even on platforms that do not
Tom Lane [Wed, 29 Mar 2006 15:16:00 +0000 (15:16 +0000)] 
TablespaceCreateDbspace should function normally even on platforms that do not
have symlinks (ie, Windows).  Although it'll never be called on to do anything
useful during normal operation on such a platform, it's still needed to
re-create dropped directories during WAL replay.

19 years agoRepair longstanding error in btree xlog replay: XLogReadBuffer should be
Tom Lane [Tue, 28 Mar 2006 21:17:44 +0000 (21:17 +0000)] 
Repair longstanding error in btree xlog replay: XLogReadBuffer should be
passed extend = true whenever we are reading a page we intend to reinitialize
completely, even if we think the page "should exist".  This is because it
might indeed not exist, if the relation got truncated sometime after the
current xlog record was made and before the crash we're trying to recover
from.  These two thinkos appear to explain both of the old bug reports
discussed here:
http://archives.postgresql.org/pgsql-hackers/2005-05/msg01369.php

19 years agoFixed bug 2330: Wrong error code in case of a duplicate key
Michael Meskes [Sun, 19 Mar 2006 12:30:17 +0000 (12:30 +0000)] 
Fixed bug 2330: Wrong error code in case of a duplicate key

19 years agoThe call to DNSServiceRegistrationCreate in postmaster.c does incorrect
Neil Conway [Sat, 18 Mar 2006 22:10:14 +0000 (22:10 +0000)] 
The call to DNSServiceRegistrationCreate in postmaster.c does incorrect
byte-swapping on the port number which causes the call to fail on Intel
Macs.

This patch uses htons() instead of htonl() and fixes this bug.

Ashley Clark

19 years agoFix order of linking of libxslt and libxml2, per Dave Page.
Tom Lane [Fri, 10 Mar 2006 15:40:06 +0000 (15:40 +0000)] 
Fix order of linking of libxslt and libxml2, per Dave Page.

19 years agoCheck for "msys" so it doesn't use 'con' by checking for an evironment
Bruce Momjian [Sun, 5 Mar 2006 05:33:47 +0000 (05:33 +0000)] 
Check for "msys" so it doesn't use 'con' by checking for an evironment
variable.

19 years agoMinor teak.
Tatsuo Ishii [Sat, 4 Mar 2006 12:37:01 +0000 (12:37 +0000)] 
Minor teak.

19 years agoTighten up SJIS byte sequence check. Now we reject invalid SJIS byte
Tatsuo Ishii [Sat, 4 Mar 2006 11:54:02 +0000 (11:54 +0000)] 
Tighten up SJIS byte sequence check. Now we reject invalid SJIS byte
sequence such as "0x95 0x27". Patches from Akio Ishida.

19 years agoUse DEVTTY as 'con' on Win32 as a replacement for /dev/tty.
Bruce Momjian [Sat, 4 Mar 2006 04:31:05 +0000 (04:31 +0000)] 
Use DEVTTY as 'con' on Win32 as a replacement for /dev/tty.

19 years agoAvoid trying to open /dev/tty on Win32. Some Win32 systems have
Bruce Momjian [Fri, 3 Mar 2006 23:54:52 +0000 (23:54 +0000)] 
Avoid trying to open /dev/tty on Win32.  Some Win32 systems have
/dev/tty, but it isn't a device file and doesn't work as expected.

This fixes a known bug where psql does not prompt for a password on some
Win32 systems.

Backpatch to 8.0.X too.

Robert Kinberg

19 years agomake initdb -U username work as advertised; back out bogus patch at rev 1.42
Andrew Dunstan [Fri, 24 Feb 2006 00:54:27 +0000 (00:54 +0000)] 
make initdb -U username work as advertised; back out bogus patch at rev 1.42
and supply real fix for problem it tried to address.

19 years agoFix three Python reference leaks in PLy_traceback(). This would result
Neil Conway [Mon, 20 Feb 2006 20:10:43 +0000 (20:10 +0000)] 
Fix three Python reference leaks in PLy_traceback(). This would result
in leaking memory when invoking a PL/Python procedure that raises an
exception. Unfortunately this still leaks memory, but at least the
largest leak has been plugged.

This patch also fixes a reference counting mistake in PLy_modify_tuple()
for 8.0, 8.1 and HEAD: we don't actually own a reference to `platt', so
we shouldn't Py_DECREF() it.

19 years agoPatch from Marko Kreen:
Neil Conway [Sat, 18 Feb 2006 20:48:56 +0000 (20:48 +0000)] 
Patch from Marko Kreen:

pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Thanks to Daniel Blaisdell for reporting it.

19 years agoMove btbulkdelete's vacuum_delay_point() call to a place in the loop where
Tom Lane [Tue, 14 Feb 2006 17:20:17 +0000 (17:20 +0000)] 
Move btbulkdelete's vacuum_delay_point() call to a place in the loop where
we are not holding a buffer content lock; where it was, InterruptHoldoffCount
is positive and so we'd not respond to cancel signals as intended.  Also
add missing vacuum_delay_point() call in btvacuumcleanup.  This should fix
complaint from Evgeny Gridasov about failure to respond to SIGINT/SIGTERM
in a timely fashion (bug #2257).

19 years agoFix qual_is_pushdown_safe to not try to push down quals involving a whole-row
Tom Lane [Mon, 13 Feb 2006 16:22:38 +0000 (16:22 +0000)] 
Fix qual_is_pushdown_safe to not try to push down quals involving a whole-row
Var referencing the subselect output.  While this case could possibly be made
to work, it seems not worth expending effort on.  Per report from Magnus
Naeslund(f).

19 years agoStamp 8.0.7. REL8_0_7
Tom Lane [Sun, 12 Feb 2006 22:38:05 +0000 (22:38 +0000)] 
Stamp 8.0.7.

19 years agoUpdate release notes.
Tom Lane [Sun, 12 Feb 2006 22:35:52 +0000 (22:35 +0000)] 
Update release notes.

19 years agoFix bug in SET SESSION AUTHORIZATION that allows unprivileged users to crash
Tom Lane [Sun, 12 Feb 2006 22:33:14 +0000 (22:33 +0000)] 
Fix bug in SET SESSION AUTHORIZATION that allows unprivileged users to crash
the server, if it has been compiled with Asserts enabled (CVE-2006-0553).
Thanks to Akio Ishida for reporting this problem.