diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-08 16:08:41 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-08 16:13:22 -0500 |
commit | d9572c4e3b474031060189050e14ef384b94e001 (patch) | |
tree | 07646762f4086b94a69b9fc215734d2bccade5db /src/backend/tcop/utility.c | |
parent | 414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0 (diff) | |
download | postgresql-d9572c4e3b474031060189050e14ef384b94e001.tar.gz postgresql-d9572c4e3b474031060189050e14ef384b94e001.zip |
Core support for "extensions", which are packages of SQL objects.
This patch adds the server infrastructure to support extensions.
There is still one significant loose end, namely how to make it play nice
with pg_upgrade, so I am not yet committing the changes that would make
all the contrib modules depend on this feature.
In passing, fix a disturbingly large amount of breakage in
AlterObjectNamespace() and callers.
Dimitri Fontaine, reviewed by Anssi Kääriäinen,
Itagaki Takahiro, Tom Lane, and numerous others
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index af2eba01d61..10a4438995f 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -32,6 +32,7 @@ #include "commands/defrem.h" #include "commands/discard.h" #include "commands/explain.h" +#include "commands/extension.h" #include "commands/lockcmds.h" #include "commands/portalcmds.h" #include "commands/prepare.h" @@ -210,6 +211,7 @@ check_xact_readonly(Node *parsetree) case T_ReassignOwnedStmt: case T_AlterTSDictionaryStmt: case T_AlterTSConfigurationStmt: + case T_CreateExtensionStmt: case T_CreateFdwStmt: case T_AlterFdwStmt: case T_DropFdwStmt: @@ -594,6 +596,10 @@ standard_ProcessUtility(Node *parsetree, AlterTableSpaceOptions((AlterTableSpaceOptionsStmt *) parsetree); break; + case T_CreateExtensionStmt: + CreateExtension((CreateExtensionStmt *) parsetree); + break; + case T_CreateFdwStmt: CreateForeignDataWrapper((CreateFdwStmt *) parsetree); break; @@ -673,6 +679,10 @@ standard_ProcessUtility(Node *parsetree, RemoveTSConfigurations(stmt); break; + case OBJECT_EXTENSION: + RemoveExtensions(stmt); + break; + default: elog(ERROR, "unrecognized drop object type: %d", (int) stmt->removeType); @@ -1544,6 +1554,10 @@ CreateCommandTag(Node *parsetree) tag = "ALTER TABLESPACE"; break; + case T_CreateExtensionStmt: + tag = "CREATE EXTENSION"; + break; + case T_CreateFdwStmt: tag = "CREATE FOREIGN DATA WRAPPER"; break; @@ -1626,6 +1640,9 @@ CreateCommandTag(Node *parsetree) case OBJECT_FOREIGN_TABLE: tag = "DROP FOREIGN TABLE"; break; + case OBJECT_EXTENSION: + tag = "DROP EXTENSION"; + break; default: tag = "???"; } @@ -1741,6 +1758,9 @@ CreateCommandTag(Node *parsetree) case OBJECT_DOMAIN: tag = "ALTER DOMAIN"; break; + case OBJECT_EXTENSION: + tag = "ALTER EXTENSION"; + break; case OBJECT_OPERATOR: tag = "ALTER OPERATOR"; break; @@ -2382,6 +2402,10 @@ GetCommandLogLevel(Node *parsetree) lev = LOGSTMT_DDL; break; + case T_CreateExtensionStmt: + lev = LOGSTMT_DDL; + break; + case T_CreateFdwStmt: case T_AlterFdwStmt: case T_DropFdwStmt: |