diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-14 15:40:21 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-14 15:40:21 -0400 |
commit | 52994e9e5686b10a92bc93ec0f4e15c7fbc18242 (patch) | |
tree | 2fbbf39905cd00eabb28d2edb33bb37f45bfe3e3 /src/backend/commands/constraint.c | |
parent | 85612039b9eab75c2a29399f3a394acd4ca4cc3f (diff) | |
download | postgresql-52994e9e5686b10a92bc93ec0f4e15c7fbc18242.tar.gz postgresql-52994e9e5686b10a92bc93ec0f4e15c7fbc18242.zip |
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.
Diffstat (limited to 'src/backend/commands/constraint.c')
0 files changed, 0 insertions, 0 deletions