diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-12-01 14:27:30 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-12-01 14:27:30 -0500 |
commit | 7b90469b71761d240bf5efe3ad5bbd228429278e (patch) | |
tree | 96ea25cfed788dcb24d897c7898e09799a1b1efb /src/include/commands/typecmds.h | |
parent | 452739df82f3cf8f061520a0bdd0af892423652f (diff) | |
download | postgresql-7b90469b71761d240bf5efe3ad5bbd228429278e.tar.gz postgresql-7b90469b71761d240bf5efe3ad5bbd228429278e.zip |
Allow adding values to an enum type created in the current transaction.
Normally it is unsafe to allow ALTER TYPE ADD VALUE in a transaction block,
because instances of the value could be added to indexes later in the same
transaction, and then they would still be accessible even if the
transaction rolls back. However, we can allow this if the enum type itself
was created in the current transaction, because then any such indexes would
have to go away entirely on rollback.
The reason for allowing this is to support pg_upgrade's new usage of
pg_restore --single-transaction: in --binary-upgrade mode, pg_dump emits
enum types as a succession of ALTER TYPE ADD VALUE commands so that it can
preserve the values' OIDs. The support is a bit limited, so we'll leave
it undocumented.
Andres Freund
Diffstat (limited to 'src/include/commands/typecmds.h')
-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 2351024c221..e87ca900892 100644 --- a/src/include/commands/typecmds.h +++ b/src/include/commands/typecmds.h @@ -26,7 +26,7 @@ extern void RemoveTypeById(Oid typeOid); extern void DefineDomain(CreateDomainStmt *stmt); extern void DefineEnum(CreateEnumStmt *stmt); extern void DefineRange(CreateRangeStmt *stmt); -extern void AlterEnum(AlterEnumStmt *stmt); +extern void AlterEnum(AlterEnumStmt *stmt, bool isTopLevel); extern Oid DefineCompositeType(RangeVar *typevar, List *coldeflist); extern Oid AssignTypeArrayOid(void); |