extension.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*-------------------------------------------------------------------------
  2. *
  3. * extension.h
  4. * Extension management commands (create/drop extension).
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, 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. #include "catalog/objectaddress.h"
  17. #include "parser/parse_node.h"
  18. /*
  19. * creating_extension is only true while running a CREATE EXTENSION or ALTER
  20. * EXTENSION UPDATE command. It instructs recordDependencyOnCurrentExtension()
  21. * to register a dependency on the current pg_extension object for each SQL
  22. * object created by an extension script. It also instructs performDeletion()
  23. * to remove such dependencies without following them, so that extension
  24. * scripts can drop member objects without having to explicitly dissociate
  25. * them from the extension first.
  26. */
  27. extern PGDLLIMPORT bool creating_extension;
  28. extern PGDLLIMPORT Oid CurrentExtensionObject;
  29. extern ObjectAddress CreateExtension(ParseState *pstate, CreateExtensionStmt *stmt);
  30. extern void RemoveExtensionById(Oid extId);
  31. extern ObjectAddress InsertExtensionTuple(const char *extName, Oid extOwner,
  32. Oid schemaOid, bool relocatable, const char *extVersion,
  33. Datum extConfig, Datum extCondition,
  34. List *requiredExtensions);
  35. extern ObjectAddress ExecAlterExtensionStmt(ParseState *pstate, AlterExtensionStmt *stmt);
  36. extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
  37. ObjectAddress *objAddr);
  38. extern Oid get_extension_oid(const char *extname, bool missing_ok);
  39. extern char *get_extension_name(Oid ext_oid);
  40. extern bool extension_file_exists(const char *extensionName);
  41. extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema,
  42. Oid *oldschema);
  43. #endif /* EXTENSION_H */