diff options
author | Andres Freund <andres@anarazel.de> | 2015-05-08 00:20:46 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2015-05-08 00:20:46 +0200 |
commit | 2c8f4836db058d0715bc30a30655d646287ba509 (patch) | |
tree | 31576f5fc453bd2dbc5642c1281640b5eb959307 /src/backend/commands/createas.c | |
parent | db5f98ab4fa44bc563ec62d7b1aada4fc276d9b2 (diff) | |
download | postgresql-2c8f4836db058d0715bc30a30655d646287ba509.tar.gz postgresql-2c8f4836db058d0715bc30a30655d646287ba509.zip |
Represent columns requiring insert and update privileges indentently.
Previously, relation range table entries used a single Bitmapset field
representing which columns required either UPDATE or INSERT privileges,
despite the fact that INSERT and UPDATE privileges are separately
cataloged, and may be independently held. As statements so far required
either insert or update privileges but never both, that was
sufficient. The required permission could be inferred from the top level
statement run.
The upcoming INSERT ... ON CONFLICT UPDATE feature needs to
independently check for both privileges in one statement though, so that
is not sufficient anymore.
Bumps catversion as stored rules change.
Author: Peter Geoghegan
Reviewed-By: Andres Freund
Diffstat (limited to 'src/backend/commands/createas.c')
-rw-r--r-- | src/backend/commands/createas.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c index 54b2f382ea0..e8f0d793b67 100644 --- a/src/backend/commands/createas.c +++ b/src/backend/commands/createas.c @@ -433,7 +433,7 @@ intorel_startup(DestReceiver *self, int operation, TupleDesc typeinfo) rte->requiredPerms = ACL_INSERT; for (attnum = 1; attnum <= intoRelationDesc->rd_att->natts; attnum++) - rte->modifiedCols = bms_add_member(rte->modifiedCols, + rte->insertedCols = bms_add_member(rte->insertedCols, attnum - FirstLowInvalidHeapAttributeNumber); ExecCheckRTPerms(list_make1(rte), true); |