From 31510194cc9d87b355cb56e7d88c18c985d7a32a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Sep 2012 18:35:22 -0400 Subject: Minor corrections for ALTER TYPE ADD VALUE IF NOT EXISTS patch. Produce a NOTICE when the label already exists, for consistency with other CREATE IF NOT EXISTS commands. Also, fix the code so it produces something more user-friendly than an index violation when the label already exists. This not incidentally enables making a regression test that the previous patch didn't make for fear of exposing an unpredictable OID in the results. Also some wordsmithing on the documentation. --- doc/src/sgml/ref/alter_type.sgml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_type.sgml b/doc/src/sgml/ref/alter_type.sgml index 588887e1f9b..99c9d50429d 100644 --- a/doc/src/sgml/ref/alter_type.sgml +++ b/doc/src/sgml/ref/alter_type.sgml @@ -109,15 +109,16 @@ ALTER TYPE name ADD VALUE [ IF NOT ADD VALUE [ IF NOT EXISTS ] [ BEFORE | AFTER ] - This form adds a new value to an enum type. If the new value's place in - the enum's ordering is not specified using BEFORE or - AFTER, then the new item is placed at the end of the - list of values. + This form adds a new value to an enum type. The new value's place in + the enum's ordering can be specified as being BEFORE + or AFTER one of the existing values. Otherwise, + the new item is added at the end of the list of values. - If IF NOT EXISTS is used, it is not an error if the - type already contains the new value, and no action is taken. Otherwise, - an error will occur if the new value is already present. + If IF NOT EXISTS is specified, it is not an error if + the type already contains the new value: a notice is issued but no other + action is taken. Otherwise, an error will occur if the new value is + already present. -- cgit v1.2.3