1 /*-------------------------------------------------------------------------
2  *
3  * extension.h
4  *		Extension management commands (create/drop extension).
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/extension.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef EXTENSION_H
15 #define EXTENSION_H
16 
17 #include "catalog/objectaddress.h"
18 #include "nodes/parsenodes.h"
19 
20 
21 /*
22  * creating_extension is only true while running a CREATE EXTENSION command.
23  * It instructs recordDependencyOnCurrentExtension() to register a dependency
24  * on the current pg_extension object for each SQL object created by its
25  * installation script.
26  */
27 extern PGDLLIMPORT bool creating_extension;
28 extern PGDLLIMPORT Oid CurrentExtensionObject;
29 
30 
31 extern ObjectAddress CreateExtension(CreateExtensionStmt *stmt);
32 
33 extern void RemoveExtensionById(Oid extId);
34 
35 extern ObjectAddress InsertExtensionTuple(const char *extName, Oid extOwner,
36 					 Oid schemaOid, bool relocatable, const char *extVersion,
37 					 Datum extConfig, Datum extCondition,
38 					 List *requiredExtensions);
39 
40 extern ObjectAddress ExecAlterExtensionStmt(AlterExtensionStmt *stmt);
41 
42 extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
43 							   ObjectAddress *objAddress);
44 
45 extern Oid	get_extension_oid(const char *extname, bool missing_ok);
46 extern char *get_extension_name(Oid ext_oid);
47 
48 extern ObjectAddress AlterExtensionNamespace(List *names, const char *newschema,
49 						Oid *oldschema);
50 
51 extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
52 
53 #endif   /* EXTENSION_H */
54