mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
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.
This commit is contained in:
@@ -65,6 +65,7 @@ typedef FormData_pg_enum *Form_pg_enum;
|
||||
extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
|
||||
extern void EnumValuesDelete(Oid enumTypeOid);
|
||||
extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
|
||||
const char *neighbor, bool newValIsAfter);
|
||||
const char *neighbor, bool newValIsAfter,
|
||||
bool skipIfExists);
|
||||
|
||||
#endif /* PG_ENUM_H */
|
||||
|
@@ -2306,6 +2306,7 @@ typedef struct AlterEnumStmt
|
||||
char *newVal; /* new enum value's name */
|
||||
char *newValNeighbor; /* neighboring enum value, if specified */
|
||||
bool newValIsAfter; /* place new enum value after neighbor? */
|
||||
bool skipIfExists; /* ignore statement if label already exists */
|
||||
} AlterEnumStmt;
|
||||
|
||||
/* ----------------------
|
||||
|
Reference in New Issue
Block a user