catalog.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*-------------------------------------------------------------------------
  2. *
  3. * catalog.h
  4. * prototypes for functions in backend/catalog/catalog.c
  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/catalog/catalog.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef CATALOG_H
  15. #define CATALOG_H
  16. /*
  17. * 'pgrminclude ignore' needed here because CppAsString2() does not throw
  18. * an error if the symbol is not defined.
  19. */
  20. #include "catalog/catversion.h" /* pgrminclude ignore */
  21. #include "catalog/pg_class.h"
  22. #include "utils/relcache.h"
  23. #define OIDCHARS 10 /* max chars printed by %u */
  24. #define TABLESPACE_VERSION_DIRECTORY "PG_" PG_MAJORVERSION "_" \
  25. CppAsString2(CATALOG_VERSION_NO)
  26. extern bool IsSystemRelation(Relation relation);
  27. extern bool IsToastRelation(Relation relation);
  28. extern bool IsCatalogRelation(Relation relation);
  29. extern bool IsSystemClass(Oid relid, Form_pg_class reltuple);
  30. extern bool IsToastClass(Form_pg_class reltuple);
  31. extern bool IsCatalogClass(Oid relid, Form_pg_class reltuple);
  32. extern bool IsSystemNamespace(Oid namespaceId);
  33. extern bool IsToastNamespace(Oid namespaceId);
  34. extern bool IsReservedName(const char *name);
  35. extern bool IsSharedRelation(Oid relationId);
  36. extern Oid GetNewOid(Relation relation);
  37. extern Oid GetNewOidWithIndex(Relation relation, Oid indexId,
  38. AttrNumber oidcolumn);
  39. extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class,
  40. char relpersistence);
  41. #endif /* CATALOG_H */