Thread: pgsql: Minor corrections for ALTER TYPE ADD VALUE IF NOT EXISTS patch.

pgsql: Minor corrections for ALTER TYPE ADD VALUE IF NOT EXISTS patch.

From
Tom Lane
Date:
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/31510194cc9d87b355cb56e7d88c18c985d7a32a

Modified Files
--------------
doc/src/sgml/ref/alter_type.sgml   |   15 ++++++++-------
src/backend/catalog/pg_enum.c      |   29 ++++++++++++++++++++---------
src/include/nodes/parsenodes.h     |    2 +-
src/test/regress/expected/enum.out |    6 +++---
src/test/regress/sql/enum.sql      |    6 +-----
5 files changed, 33 insertions(+), 25 deletions(-)