aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/extension.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-02-08 16:08:41 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-02-08 16:13:22 -0500
commitd9572c4e3b474031060189050e14ef384b94e001 (patch)
tree07646762f4086b94a69b9fc215734d2bccade5db /src/include/commands/extension.h
parent414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0 (diff)
downloadpostgresql-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/include/commands/extension.h')
-rw-r--r--src/include/commands/extension.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
new file mode 100644
index 00000000000..10d08935a00
--- /dev/null
+++ b/src/include/commands/extension.h
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ *
+ * extension.h
+ * Extension management commands (create/drop extension).
+ *
+ *
+ * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/commands/extension.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXTENSION_H
+#define EXTENSION_H
+
+#include "nodes/parsenodes.h"
+
+
+/*
+ * creating_extension is only true while running a CREATE EXTENSION command.
+ * It instructs recordDependencyOnCurrentExtension() to register a dependency
+ * on the current pg_extension object for each SQL object created by its
+ * installation script.
+ */
+extern bool creating_extension;
+extern Oid CurrentExtensionObject;
+
+
+extern void CreateExtension(CreateExtensionStmt *stmt);
+
+extern void RemoveExtensions(DropStmt *stmt);
+extern void RemoveExtensionById(Oid extId);
+
+extern Oid get_extension_oid(const char *extname, bool missing_ok);
+extern char *get_extension_name(Oid ext_oid);
+
+extern void AlterExtensionNamespace(List *names, const char *newschema);
+
+#endif /* EXTENSION_H */