1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-01 14:21:49 +03:00

21856 Commits

Author SHA1 Message Date
Bruce Momjian
512d7eab82 Move "#define inline __inline" from port/win32.h to c.h because Win32
interface builds like libpq need it.

Backpatch addition to 8.1.X.
2006-08-10 01:35:28 +00:00
Bruce Momjian
a42c545f62 Round microseconds on setitimer upwards. 2006-08-09 21:18:15 +00:00
Bruce Momjian
83b27b9180 On Win32, make minimum setitimer() sleep be 1ms, so sleeps < 1ms aren't
rounded down to zero.

Backpatch to 8.1.X.
2006-08-09 20:41:07 +00:00
Bruce Momjian
1e35f9aa04 Fix statement_timeout on Win32 so that it properly treats micro-seconds
as micro-seconds, rather than as 100 microseconds, as it does now.  This
actually fixes all setitimer calls on Win32, but statement_timeout is
the most visible fix.

Backpatch to 8.1.X.  8.0 works as documented.
2006-08-09 17:47:06 +00:00
Teodor Sigaev
73761f3659 Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com> 2006-08-08 15:45:24 +00:00
Tom Lane
804e7c5c53 Back-port HEAD's configure fixes to select appropriate compiler switches
for Intel's icc and AIX's xlc.
2006-08-07 20:08:44 +00:00
Teodor Sigaev
e33ab5b6d5 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.
2006-08-07 17:40:20 +00:00
Neil Conway
381ebcd21f Fix references to the Options section in the pgcrypto documentation.
Patch from Michael Fuhr.
2006-08-05 00:29:14 +00:00
Tom Lane
dc84334f1e Fix documentation error: GRANT/REVOKE for roles only accept role names
as grantees, not PUBLIC ... and you can't say GROUP either.  Noted by
Brian Hurt.
2006-08-02 16:30:00 +00:00
Alvaro Herrera
8aa826a965 Fix confusion between COPY FROM and COPY TO, per Gavin Sharry and Arul Shaji. 2006-07-31 01:13:58 +00:00
Andrew Dunstan
e482136c04 prevent multiplexing Windows kernel event objects we listen for across various sockets - should fix the occasional stats test regression failures we see. 2006-07-29 20:00:00 +00:00
Tom Lane
271852a021 Fix table title. 2006-07-28 16:22:02 +00:00
Tom Lane
87953b3d60 Make it clearer that not every Postgres character set can be used as a
server-side character set.
2006-07-28 15:33:28 +00:00
Peter Eisentraut
6779710f26 Fix spectacular misspellings of procedural language names 2006-07-24 16:55:42 +00:00
Tom Lane
69f3a5c9ed Fix oversight in sizing of shared buffer lookup hashtable. Because
BufferAlloc tries to insert a new mapping entry before deleting the old one
for a buffer, we have a transient need for more than NBuffers entries ---
one more in 8.1, and as many as NUM_BUFFER_PARTITIONS more in CVS HEAD.
In theory this could lead to an "out of shared memory" failure if shmem
had already been completely claimed by the time the extra entries were
needed.
2006-07-23 18:34:50 +00:00
Tom Lane
eda117dfa0 Hmm, seems --disable-spinlocks has been broken for awhile and nobody
noticed.  Fix SpinlockSemas() to report the correct count considering
that PG 8.1 adds a spinlock to each shared-buffer header.
2006-07-22 21:04:46 +00:00
Tom Lane
f141880150 Don't try to truncate multixact SLRU files in checkpoints done during xlog
recovery.  In the first place, it doesn't work because slru's
latest_page_number isn't set up yet (this is why we've been hearing reports
of strange "apparent wraparound" log messages during crash recovery, but
only from people who'd managed to advance their next-mxact counters some
considerable distance from 0).  In the second place, it seems a bit unwise
to be throwing away data during crash recovery anwyway.  This latter
consideration convinces me to just disable truncation during recovery,
rather than computing latest_page_number and pushing ahead.
2006-07-20 00:46:56 +00:00
Tom Lane
74dac69e3c 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.
2006-07-16 18:17:23 +00:00
Tom Lane
78e8400a52 Add dependency to fix parallel-make race condition. Alexander Dupuy 2006-07-14 16:45:48 +00:00
Neil Conway
0c1db67f6a Correct the description of the pg_get_viewdef() function. Do some nearby
SGML cleanup: sort table entries alphabetically.
2006-07-11 19:11:27 +00:00
Tom Lane
8d716f0e47 Remove no-longer-needed configure test for krb5_encrypt(), per Jim Gates. 2006-07-11 16:15:03 +00:00
Teodor Sigaev
f446ede326 Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.
2006-07-11 16:02:50 +00:00
Tom Lane
e0bb171960 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.
2006-07-10 22:10:47 +00:00
Bruce Momjian
fe204535a7 Backpatch dbmirror fix for escape handling.
> 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?

Olivier, can you please confirm that the patch works for you, too?

Backpatched to 8.0.X.

Martin Pitt
2006-07-06 01:57:34 +00:00
Michael Meskes
bf1cd364b6 Fixed remaining Coverity bugs. 2006-07-05 10:50:06 +00:00
Alvaro Herrera
8728d4aba9 Fix memory leak introduced in the prior commit, detected by Tom Lane. 2006-06-30 16:55:41 +00:00
Alvaro Herrera
55a39e0b0b Fix use-after-free error reported by Neil Conway. 2006-06-30 15:06:16 +00:00
Tom Lane
60f46dee71 Fix typo. 2006-06-27 14:01:42 +00:00
Alvaro Herrera
4ca74397b4 Clamp last_anl_tuples to n_live_tuples, in case we vacuum a table without
analyzing, so that future analyze threshold calculations don't get confused.
Also, make sure we correctly track the decrease of live tuples cause by
deletes.

Per report from Dylan Hansen, patches by Tom Lane and me.
2006-06-27 03:45:28 +00:00
Bruce Momjian
cc6dbbeefc Fix for recent Win32 pg_dump tar temp file patch.
Hiroshi Saito
2006-06-27 02:56:46 +00:00
Bruce Momjian
837a7df8dd On Win32, use loop to create pg_dump temporary tar file in the current
directory, not in device root, for permission reasons.

Backpatch to 8.1.X.
2006-06-27 01:17:05 +00:00
Michael Meskes
88f396e1cb Added missing braces to prevent a segfault after usage of an undeclared cursor. 2006-06-26 14:12:42 +00:00
Michael Meskes
1bdea12e5c Added some more coverity report patches send in by Joachim Wieland <joe@mcknight.de>. 2006-06-26 09:20:19 +00:00
Tom Lane
1f9acaf21d Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.
palloc() will normally round allocation requests up to the next power of 2,
so make dynahash choose allocation sizes that are as close to a power of 2
as possible.
Back-patch to 8.1 --- the problem exists further back, but a much larger
patch would be needed and it doesn't seem worth taking any risks.
2006-06-25 18:29:56 +00:00
Michael Meskes
5ececcbbf5 Moved some free() calls that coverity correctly complains about. 2006-06-25 09:59:18 +00:00
Alvaro Herrera
15af8b771b 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.
2006-06-25 04:38:00 +00:00
Tom Lane
1c718dd8bf pg_stop_backup was calling XLogArchiveNotify() twice for the newly created
backup history file.  Bug introduced by the 8.1 change to make pg_stop_backup
delete older history files.  Per report from Masao Fujii.
2006-06-22 20:43:20 +00:00
Tom Lane
62ae14545b Disallow aggregate functions in UPDATE commands (unless within a sub-SELECT).
This is disallowed by the SQL spec because it doesn't have any very sensible
interpretation.  Historically Postgres has allowed it but behaved strangely.
As of PG 8.1 a server crash is possible if the MIN/MAX index optimization gets
applied; rather than try to "fix" that, it seems best to just enforce the
spec restriction.  Per report from Josh Drake and Alvaro Herrera.
2006-06-21 18:30:19 +00:00
Joe Conway
e582d2ee1a - During dblink_open, if transaction state was IDLE, force cursor count to
initially be 0. This is needed as a previous ABORT might have wiped out
  an automatically opened transaction without maintaining the cursor count.
- Fix regression test expected file for the correct ERROR message, which
  we now get given the above bug fix.
2006-06-21 16:43:46 +00:00
Michael Meskes
ca1d26338b Added some more coverity report patches send in by Martijn van Oosterhout <kleptog@svana.org>. 2006-06-21 11:38:26 +00:00
Michael Meskes
08f1973911 Added fixes from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Added missing error handling in a few functions in ecpglib.
2006-06-21 10:29:50 +00:00
Michael Meskes
23623f05f0 Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>
2006-06-19 09:20:07 +00:00
Tom Lane
63b103aac8 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.
2006-06-18 16:21:32 +00:00
Andrew Dunstan
b243d39456 backport workaround for OpenBSD compiler bug 2006-06-17 14:49:02 +00:00
Tom Lane
33e125cc0b Clean up after someone's curious idea that it'd be good to strip
leading zeroes from the SQLSTATE codes.  They're strings, people,
not numbers.
2006-06-16 22:41:50 +00:00
Bruce Momjian
f44391b0a0 Document issues with non-default tablespaces and pg_dumpall restores.
Backpatch documentation addition to 8.1.X.
2006-06-16 22:01:22 +00:00
Bruce Momjian
4cfe1fadad Avoid use of C commment inside C comment from recent Win32 int overflow patch. 2006-06-12 16:29:08 +00:00
Bruce Momjian
f7a0b645f5 Win32 can't catch the exception thrown by INT_MIN / -1 or INT_MIN * -1,
so on that platform we test for those before the computation and throw
an "out of range" error.

Backpatch to 8.1.X.
2006-06-12 16:09:39 +00:00
Tom Lane
b45f5bb726 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.
2006-06-11 15:49:36 +00:00
Tom Lane
98365a1e34 Repair remarkably-inefficient query for dumping large object comments: it
was invoking obj_description() for each large object chunk, instead of once
per large object.  This code is new as of 8.1, which may explain why the
problem hadn't been noticed already.
2006-06-09 19:46:17 +00:00