1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +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:
Tom Lane
2011-02-09 11:55:32 -05:00
parent 70802e0dbe
commit 5bc178b89f
10 changed files with 600 additions and 254 deletions

View File

@@ -1060,13 +1060,13 @@ typedef struct SetOperationStmt
/*
* When a command can act on several kinds of objects with only one
* parse structure required, use these constants to designate the
* object type.
* object type. Note that commands typically don't support all the types.
*/
typedef enum ObjectType
{
OBJECT_AGGREGATE,
OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */
OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */
OBJECT_CAST,
OBJECT_COLUMN,
OBJECT_CONSTRAINT,
@@ -1535,7 +1535,7 @@ typedef struct AlterTableSpaceOptionsStmt
} AlterTableSpaceOptionsStmt;
/* ----------------------
* Create Extension Statement
* Create/Alter Extension Statements
* ----------------------
*/
@@ -1546,6 +1546,15 @@ typedef struct CreateExtensionStmt
List *options; /* List of DefElem nodes */
} CreateExtensionStmt;
typedef struct AlterExtensionAddStmt
{
NodeTag type;
char *extname; /* Extension's name */
ObjectType objtype; /* Object's type */
List *objname; /* Qualified name of the object */
List *objargs; /* Arguments if needed (eg, for functions) */
} AlterExtensionAddStmt;
/* ----------------------
* Create/Drop FOREIGN DATA WRAPPER Statements
* ----------------------