pg_namespace.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_namespace.h
  4. * definition of the "namespace" system catalog (pg_namespace)
  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/catalog/pg_namespace.h
  11. *
  12. * NOTES
  13. * The Catalog.pm module reads this file and derives schema
  14. * information.
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #ifndef PG_NAMESPACE_H
  19. #define PG_NAMESPACE_H
  20. #include "catalog/genbki.h"
  21. #include "catalog/pg_namespace_d.h"
  22. #include "utils/acl.h"
  23. /* ----------------------------------------------------------------
  24. * pg_namespace definition.
  25. *
  26. * cpp turns this into typedef struct FormData_pg_namespace
  27. *
  28. * nspname name of the namespace
  29. * nspowner owner (creator) of the namespace
  30. * nspacl access privilege list
  31. * ----------------------------------------------------------------
  32. */
  33. CATALOG(pg_namespace,2615,NamespaceRelationId)
  34. {
  35. Oid oid; /* oid */
  36. NameData nspname;
  37. Oid nspowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
  38. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  39. aclitem nspacl[1];
  40. #endif
  41. } FormData_pg_namespace;
  42. /* ----------------
  43. * Form_pg_namespace corresponds to a pointer to a tuple with
  44. * the format of pg_namespace relation.
  45. * ----------------
  46. */
  47. typedef FormData_pg_namespace *Form_pg_namespace;
  48. DECLARE_TOAST(pg_namespace, 4163, 4164);
  49. DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, NamespaceNameIndexId, on pg_namespace using btree(nspname name_ops));
  50. DECLARE_UNIQUE_INDEX_PKEY(pg_namespace_oid_index, 2685, NamespaceOidIndexId, on pg_namespace using btree(oid oid_ops));
  51. /*
  52. * prototypes for functions in pg_namespace.c
  53. */
  54. extern Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp);
  55. #endif /* PG_NAMESPACE_H */