postgresql/src/backend
Tom Lane 52994e9e56 Fix unsafe order of operations in foreign-table DDL commands.
When updating or deleting a system catalog tuple, it's necessary to acquire
RowExclusiveLock on the catalog before looking up the tuple; otherwise a
concurrent VACUUM FULL on the catalog might move the tuple to a different
TID before we can apply the update.  Coding patterns that find the tuple
via a table scan aren't at risk here, but when obtaining the tuple from a
catalog cache, correct ordering is important; and several routines in
foreigncmds.c got it wrong.  Noted while running the regression tests in
parallel with VACUUM FULL of assorted system catalogs.

For consistency I moved all the heap_open calls to the starts of their
functions, including a couple for which there was no actual bug.

Back-patch to 8.4 where foreigncmds.c was added.
2011-08-14 15:40:21 -04:00
..
access Change the autovacuum launcher to use WaitLatch instead of a poll loop. 2011-08-10 12:22:21 -04:00
bootstrap Avoid index rebuild for no-rewrite ALTER TABLE .. ALTER TYPE. 2011-07-18 11:04:43 -04:00
catalog Unbreak legacy syntax "COMMENT ON RULE x IS y", with no relation name. 2011-08-11 11:23:51 -04:00
commands Fix unsafe order of operations in foreign-table DDL commands. 2011-08-14 15:40:21 -04:00
executor Avoid integer overflow when LIMIT + OFFSET >= 2^63. 2011-08-02 10:47:17 +03:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Use clearer notation for getnameinfo() return handling 2011-08-09 18:30:32 +03:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Allow per-column foreign data wrapper options. 2011-08-05 13:24:03 -04:00
optimizer Avoid creating PlaceHolderVars immediately within PlaceHolderVars. 2011-08-09 11:34:20 -04:00
parser Allow per-column foreign data wrapper options. 2011-08-05 13:24:03 -04:00
po Fixed string in German translation that causes segfault. 2011-06-20 13:53:15 +02:00
port Teach unix_latch.c to use poll() where available. 2011-08-11 12:50:22 -04:00
postmaster Add a bit of debug logging to backend_read_statsfile(). 2011-08-10 16:45:43 -04:00
regex Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
replication Remove wal_sender_delay GUC, because it's no longer useful. 2011-08-10 18:50:28 -04:00
rewrite Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Change the autovacuum launcher to use WaitLatch instead of a poll loop. 2011-08-10 12:22:21 -04:00
tcop Change the autovacuum launcher to use WaitLatch instead of a poll loop. 2011-08-10 12:22:21 -04:00
tsearch Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
utils Fix incorrect timeout handling during initial authentication transaction. 2011-08-13 17:52:24 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
Makefile Fix symlink for errcodes.h so it works in VPATH builds from tarballs. 2011-06-22 13:08:08 -04:00
nls.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00