From 6d12b68cd7a93e279c8c690749b334c9f59ac7fa Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sat, 22 Sep 2012 12:53:31 -0400 Subject: 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. --- doc/src/sgml/ref/alter_type.sgml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_type.sgml b/doc/src/sgml/ref/alter_type.sgml index 6386085a608..1ff53923fb6 100644 --- a/doc/src/sgml/ref/alter_type.sgml +++ b/doc/src/sgml/ref/alter_type.sgml @@ -28,7 +28,7 @@ ALTER TYPE name OWNER TO name RENAME ATTRIBUTE attribute_name TO new_attribute_name ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] ALTER TYPE name SET SCHEMA new_schema -ALTER TYPE name ADD VALUE new_enum_value [ { BEFORE | AFTER } existing_enum_value ] +ALTER TYPE name ADD VALUE [ IF NOT EXISTS ] new_enum_value [ { BEFORE | AFTER } existing_enum_value ] where action is one of: @@ -106,7 +106,7 @@ ALTER TYPE name ADD VALUE - ADD VALUE [ BEFORE | AFTER ] + ADD VALUE [ IF NOT EXISTS ] [ BEFORE | AFTER ] This form adds a new value to an enum type. If the new value's place in @@ -114,6 +114,11 @@ ALTER TYPE name ADD VALUE AFTER, then the new item is placed at the end of the list of values. + + If IF NOT EXISTS -- cgit v1.2.3