postgresql/src
Tom Lane 32616fb1d5 Fix a problem introduced by my patch of 2010-01-12 that revised the way
relcache reload works.  In the patched code, a relcache entry in process of
being rebuilt doesn't get unhooked from the relcache hash table; which means
that if a cache flush occurs due to sinval queue overrun while we're
rebuilding it, the entry could get blown away by RelationCacheInvalidate,
resulting in crash or misbehavior.  Fix by ensuring that an entry being
rebuilt has positive refcount, so it won't be seen as a target for removal
if a cache flush occurs.  (This will mean that the entry gets rebuilt twice
in such a scenario, but that's okay.)  It appears that the problem can only
arise within a transaction that has previously reassigned the relfilenode of
a pre-existing table, via TRUNCATE or a similar operation.  Per bug #5412
from Rusty Conover.

Back-patch to 8.2, same as the patch that introduced the problem.
I think that the failure can't actually occur in 8.2, since it lacks the
rd_newRelfilenodeSubid optimization, but let's make it work like the later
branches anyway.

Patch by Heikki, slightly editorialized on by me.
2010-04-14 21:31:27 +00:00
..
backend Fix a problem introduced by my patch of 2010-01-12 that revised the way 2010-04-14 21:31:27 +00:00
bin Return proper exit code (3) from psql when ON_ERROR_STOP=on and 2010-03-09 01:10:05 +00:00
include Don't pass an invalid file handle to dup2(). That causes a crash on 2010-04-01 20:12:34 +00:00
interfaces tag 8.3.10 2010-03-12 03:40:31 +00:00
makefiles
pl Sync perl's ppport.h on all branches back to 7.4 with recent update on HEAD, ensuring we can build older branches with modern Perl installations. 2010-04-03 17:54:14 +00:00
port tag 8.3.10 2010-03-12 03:40:31 +00:00
template
test Fix ExecEvalArrayRef to pass down the old value of the array element or slice 2010-02-18 18:42:04 +00:00
timezone Clean up inconsistent commas 2010-04-09 11:49:58 +00:00
tools Make iconv work like other optional libraries for MSVC. 2010-03-03 03:28:35 +00:00
tutorial
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk
win32.mak