Commit ef74e03e authored by Peter Eisentraut's avatar Peter Eisentraut

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: zam6ak@gmail.com
Bug: #14718
parent 572d6ee6
...@@ -827,7 +827,7 @@ rewriteTargetListIU(List *targetList, ...@@ -827,7 +827,7 @@ rewriteTargetListIU(List *targetList,
if (commandType == CMD_UPDATE) 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, ereport(ERROR,
(errcode(ERRCODE_GENERATED_ALWAYS), (errcode(ERRCODE_GENERATED_ALWAYS),
errmsg("column \"%s\" can only be updated to DEFAULT", NameStr(att_tup->attname)), errmsg("column \"%s\" can only be updated to DEFAULT", NameStr(att_tup->attname)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment