diff options
| author | Tom Lane | 2016-09-05 16:59:55 +0000 |
|---|---|---|
| committer | Tom Lane | 2016-09-05 16:59:55 +0000 |
| commit | 15bc038f9bcd1a9af3f625caffafc7c20322202d (patch) | |
| tree | dd929ef19d7f5bc751ec5528be37a66eae6bb0ce /src/include/commands | |
| parent | 016abf1fb8333de82a259af0cc7572a4b868023b (diff) | |
Relax transactional restrictions on ALTER TYPE ... ADD VALUE.
To prevent possibly breaking indexes on enum columns, we must keep
uncommitted enum values from getting stored in tables, unless we
can be sure that any such column is new in the current transaction.
Formerly, we enforced this by disallowing ALTER TYPE ... ADD VALUE
from being executed at all in a transaction block, unless the target
enum type had been created in the current transaction. This patch
removes that restriction, and instead insists that an uncommitted enum
value can't be referenced unless it belongs to an enum type created
in the same transaction as the value. Per discussion, this should be
a bit less onerous. It does require each function that could possibly
return a new enum value to SQL operations to check this restriction,
but there aren't so many of those that this seems unmaintainable.
Andrew Dunstan and Tom Lane
Discussion: <4075.1459088427@sss.pgh.pa.us>
Diffstat (limited to 'src/include/commands')
| -rw-r--r-- | src/include/commands/typecmds.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h index e4c86f1b1dc..847b770f00c 100644 --- a/src/include/commands/typecmds.h +++ b/src/include/commands/typecmds.h @@ -26,7 +26,7 @@ extern void RemoveTypeById(Oid typeOid); extern ObjectAddress DefineDomain(CreateDomainStmt *stmt); extern ObjectAddress DefineEnum(CreateEnumStmt *stmt); extern ObjectAddress DefineRange(CreateRangeStmt *stmt); -extern ObjectAddress AlterEnum(AlterEnumStmt *stmt, bool isTopLevel); +extern ObjectAddress AlterEnum(AlterEnumStmt *stmt); extern ObjectAddress DefineCompositeType(RangeVar *typevar, List *coldeflist); extern Oid AssignTypeArrayOid(void); |
