diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-05-12 16:43:32 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-05-12 16:43:32 +0000 |
commit | f23bdda3240d3aa511c843a4f91870d17b53b970 (patch) | |
tree | dde3dcced0604a669eb4a91a6d9c8af100be10fc /src/include/access/heapam.h | |
parent | d4a363cdf2b426bbf6c401543b8286ad86ca9bd5 (diff) | |
download | postgresql-f23bdda3240d3aa511c843a4f91870d17b53b970.tar.gz postgresql-f23bdda3240d3aa511c843a4f91870d17b53b970.zip |
Fix LOCK TABLE to eliminate the race condition that could make it give weird
errors when tables are concurrently dropped. To do this we must take lock
on each relation before we check its privileges. The old code was trying
to do that the other way around, which is a bit pointless when there are lots
of other commands that lock relations before checking privileges. I did keep
it checking each relation's privilege before locking the next relation, which
is a detail that ALTER TABLE isn't too picky about.
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r-- | src/include/access/heapam.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index d773652d0d5..ec49192cacc 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.141 2009/01/01 17:23:56 momjian Exp $ + * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.142 2009/05/12 16:43:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -49,7 +49,6 @@ typedef enum /* in heap/heapam.c */ extern Relation relation_open(Oid relationId, LOCKMODE lockmode); extern Relation try_relation_open(Oid relationId, LOCKMODE lockmode); -extern Relation relation_open_nowait(Oid relationId, LOCKMODE lockmode); extern Relation relation_openrv(const RangeVar *relation, LOCKMODE lockmode); extern Relation try_relation_openrv(const RangeVar *relation, LOCKMODE lockmode); extern void relation_close(Relation relation, LOCKMODE lockmode); |