pgsql: Allow IF NOT EXISTS when add a new enum label.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема pgsql: Allow IF NOT EXISTS when add a new enum label.
Дата
Msg-id E1TFT6H-0003oc-1d@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve ruleutils.c's heuristics for dealing with rangetable ali
Следующее
От: Andrew Dunstan
Дата:
Сообщение: pgsql: Fix docs typo