1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Allow new values to be added to an existing enum type.

After much expenditure of effort, we've got this to the point where the
performance penalty is pretty minimal in typical cases.

Andrew Dunstan, reviewed by Brendan Jurd, Dean Rasheed, and Tom Lane
This commit is contained in:
Tom Lane
2010-10-24 23:04:37 -04:00
parent 24b29ca8f9
commit 84c123be1d
23 changed files with 1422 additions and 170 deletions

View File

@ -2901,6 +2901,19 @@ _copyCreateEnumStmt(CreateEnumStmt *from)
return newnode;
}
static AlterEnumStmt *
_copyAlterEnumStmt(AlterEnumStmt *from)
{
AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
COPY_NODE_FIELD(typeName);
COPY_STRING_FIELD(newVal);
COPY_STRING_FIELD(newValNeighbor);
COPY_SCALAR_FIELD(newValIsAfter);
return newnode;
}
static ViewStmt *
_copyViewStmt(ViewStmt *from)
{
@ -4064,6 +4077,9 @@ copyObject(void *from)
case T_CreateEnumStmt:
retval = _copyCreateEnumStmt(from);
break;
case T_AlterEnumStmt:
retval = _copyAlterEnumStmt(from);
break;
case T_ViewStmt:
retval = _copyViewStmt(from);
break;