summaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-02-09 11:55:32 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-02-09 11:56:37 -0500
commit5bc178b89f3ab93fb3845a941769c212f5eeaf1a (patch)
tree30f60f6497e97bf4c792bd581a3296aff5a6c5e5 /src/backend/nodes/copyfuncs.c
parent70802e0dbef0af4bf73ce25489b8be6e40eca2be (diff)
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 851186146dd..3d898326d7a 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -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;