postgresql/src/backend
Tom Lane feeb526cfe Fix ExecOpenScanRelation to take a lock on a ROW_MARK_COPY relation.
ExecOpenScanRelation assumed that any relation listed in the ExecRowMark
list has been locked by InitPlan; but this is not true if the rel's
markType is ROW_MARK_COPY, which is possible if it's a foreign table.

In most (possibly all) cases, failure to acquire a lock here isn't really
problematic because the parser, planner, or plancache would have taken the
appropriate lock already.  In principle though it might leave us vulnerable
to working with a relation that we hold no lock on, and in any case if the
executor isn't depending on previously-taken locks otherwise then it should
not do so for ROW_MARK_COPY relations.

Noted by Etsuro Fujita.  Back-patch to all active versions, since the
inconsistency has been there a long time.  (It's almost certainly
irrelevant in 9.0, since that predates foreign tables, but the code's
still wrong on its own terms.)
2015-03-24 15:53:06 -04:00
..
access Don't delay replication for less than recovery_min_apply_delay's resolution. 2015-03-23 16:51:11 +01:00
bootstrap Change many routines to return ObjectAddress rather than OID 2015-03-03 14:10:50 -03:00
catalog Allow foreign tables to participate in inheritance. 2015-03-22 13:53:21 -04:00
commands Allow foreign tables to participate in inheritance. 2015-03-22 13:53:21 -04:00
executor Fix ExecOpenScanRelation to take a lock on a ROW_MARK_COPY relation. 2015-03-24 15:53:06 -04:00
foreign Update copyright for 2015 2015-01-06 11:43:47 -05:00
lib Fix a bug in pairing heap removal code. 2015-02-17 22:55:53 +02:00
libpq Use FLEXIBLE_ARRAY_MEMBER in a number of other places. 2015-02-21 16:12:14 -05:00
main Don't require users of src/port/gettimeofday.c to initialize it. 2015-02-21 12:17:04 -05:00
nodes Rationalize vacuuming options and parameters 2015-03-18 11:52:33 -03:00
optimizer Allow foreign tables to participate in inheritance. 2015-03-22 13:53:21 -04:00
parser Allow foreign tables to participate in inheritance. 2015-03-22 13:53:21 -04:00
po Translation updates 2015-02-01 23:23:40 -05:00
port Remove the option to service interrupts during PGSemaphoreLock(). 2015-02-03 23:25:00 +01:00
postmaster Fix status reporting for terminated bgworkers that were never started. 2015-03-19 11:04:09 -04:00
regex Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
replication Merge the various forms of transaction commit & abort records. 2015-03-15 17:37:07 +01:00
rewrite Change many routines to return ObjectAddress rather than OID 2015-03-03 14:10:50 -03:00
snowball Update copyright for 2015 2015-01-06 11:43:47 -05:00
storage Remove ill-advised pre-check for DSM segment exhaustion. 2015-03-23 09:58:56 -04:00
tcop Rationalize vacuuming options and parameters 2015-03-18 11:52:33 -03:00
tsearch Update copyright for 2015 2015-01-06 11:43:47 -05:00
utils Apply table and domain CHECK constraints in name order. 2015-03-23 16:59:35 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
nls.mk Translation updates 2015-02-01 23:23:40 -05:00