diff options
author | Peter Eisentraut | 2017-07-01 03:44:17 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-07-01 03:44:17 +0000 |
commit | ef74e03ef65ea870a9c372f500d33cca0a18be6e (patch) | |
tree | de029669f6a34dcff2da8b5d241a2655be77dc58 | |
parent | 572d6ee6d41b43b8871f42c7dbbef795523b2dbf (diff) |
Fix UPDATE of GENERATED ALWAYS identity columns
The bug would previously prevent the update of any column in a table
with identity columns, rather than just the actual identity column.
Reported-by: [email protected]
Bug: #14718
-rw-r--r-- | src/backend/rewrite/rewriteHandler.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 622521630d..f3c7526195 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -827,7 +827,7 @@ rewriteTargetListIU(List *targetList, if (commandType == CMD_UPDATE) { - if (att_tup->attidentity == ATTRIBUTE_IDENTITY_ALWAYS && !apply_default) + if (att_tup->attidentity == ATTRIBUTE_IDENTITY_ALWAYS && new_tle && !apply_default) ereport(ERROR, (errcode(ERRCODE_GENERATED_ALWAYS), errmsg("column \"%s\" can only be updated to DEFAULT", NameStr(att_tup->attname)), |