pgsql: Allow IF NOT EXISTS when add a new enum label. - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Allow IF NOT EXISTS when add a new enum label.
Date
Msg-id E1TFT6H-0003oc-1d@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6d12b68cd7a93e279c8c690749b334c9f59ac7fa

Modified Files
--------------
doc/src/sgml/ref/alter_type.sgml   |    9 +++++++--
src/backend/catalog/pg_enum.c      |   18 +++++++++++++++++-
src/backend/commands/typecmds.c    |    3 ++-
src/backend/nodes/copyfuncs.c      |    1 +
src/backend/nodes/equalfuncs.c     |    1 +
src/backend/parser/gram.y          |   25 ++++++++++++++++---------
src/include/catalog/pg_enum.h      |    3 ++-
src/include/nodes/parsenodes.h     |    1 +
src/test/regress/expected/enum.out |   22 ++++++++++++++++++++++
src/test/regress/sql/enum.sql      |   20 ++++++++++++++++++++
10 files changed, 89 insertions(+), 14 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Improve ruleutils.c's heuristics for dealing with rangetable ali
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Fix docs typo