mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Implement "ALTER EXTENSION ADD object".
This is an essential component of making the extension feature usable; first because it's needed in the process of converting an existing installation containing "loose" objects of an old contrib module into the extension-based world, and second because we'll have to use it in pg_dump --binary-upgrade, as per recent discussion. Loosely based on part of Dimitri Fontaine's ALTER EXTENSION UPGRADE patch.
This commit is contained in:
@ -3250,6 +3250,19 @@ _copyCreateExtensionStmt(CreateExtensionStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterExtensionAddStmt *
|
||||
_copyAlterExtensionAddStmt(AlterExtensionAddStmt *from)
|
||||
{
|
||||
AlterExtensionAddStmt *newnode = makeNode(AlterExtensionAddStmt);
|
||||
|
||||
COPY_STRING_FIELD(extname);
|
||||
COPY_SCALAR_FIELD(objtype);
|
||||
COPY_NODE_FIELD(objname);
|
||||
COPY_NODE_FIELD(objargs);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateFdwStmt *
|
||||
_copyCreateFdwStmt(CreateFdwStmt *from)
|
||||
{
|
||||
@ -4252,6 +4265,9 @@ copyObject(void *from)
|
||||
case T_CreateExtensionStmt:
|
||||
retval = _copyCreateExtensionStmt(from);
|
||||
break;
|
||||
case T_AlterExtensionAddStmt:
|
||||
retval = _copyAlterExtensionAddStmt(from);
|
||||
break;
|
||||
case T_CreateFdwStmt:
|
||||
retval = _copyCreateFdwStmt(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user