diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2012-09-22 12:53:31 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2012-09-22 12:53:31 -0400 |
commit | 6d12b68cd7a93e279c8c690749b334c9f59ac7fa (patch) | |
tree | fadc9d82179c4ad7cd49198c97208b17e9db45bc /src/backend/commands/typecmds.c | |
parent | 11e131854f8231a21613f834c40fe9d046926387 (diff) | |
download | postgresql-6d12b68cd7a93e279c8c690749b334c9f59ac7fa.tar.gz postgresql-6d12b68cd7a93e279c8c690749b334c9f59ac7fa.zip |
Allow IF NOT EXISTS when add a new enum label.
If the label is already in the enum the statement becomes a no-op.
This will reduce the pain that comes from our not allowing this
operation inside a transaction block.
Andrew Dunstan, reviewed by Tom Lane and Magnus Hagander.
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r-- | src/backend/commands/typecmds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 4c9d00386cb..6cb6fd56fd9 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -1188,7 +1188,8 @@ AlterEnum(AlterEnumStmt *stmt) /* Add the new label */ AddEnumLabel(enum_type_oid, stmt->newVal, - stmt->newValNeighbor, stmt->newValIsAfter); + stmt->newValNeighbor, stmt->newValIsAfter, + stmt->skipIfExists); ReleaseSysCache(tup); } |