pg_shdepend.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_shdepend.h
  4. * definition of the "shared dependency" system catalog (pg_shdepend)
  5. *
  6. * pg_shdepend has no preloaded contents, so there is no pg_shdepend.dat
  7. * file; dependencies for system-defined objects are loaded into it
  8. * on-the-fly during initdb. Most built-in objects are pinned anyway,
  9. * and hence need no explicit entries in pg_shdepend.
  10. *
  11. * NOTE: we do not represent all possible dependency pairs in pg_shdepend;
  12. * for example, there's not much value in creating an explicit dependency
  13. * from a relation to its database. Currently, only dependencies on roles
  14. * are explicitly stored in pg_shdepend.
  15. *
  16. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  17. * Portions Copyright (c) 1994, Regents of the University of California
  18. *
  19. * src/include/catalog/pg_shdepend.h
  20. *
  21. * NOTES
  22. * The Catalog.pm module reads this file and derives schema
  23. * information.
  24. *
  25. *-------------------------------------------------------------------------
  26. */
  27. #ifndef PG_SHDEPEND_H
  28. #define PG_SHDEPEND_H
  29. #include "catalog/genbki.h"
  30. #include "catalog/pg_shdepend_d.h"
  31. /* ----------------
  32. * pg_shdepend definition. cpp turns this into
  33. * typedef struct FormData_pg_shdepend
  34. * ----------------
  35. */
  36. CATALOG(pg_shdepend,1214,SharedDependRelationId) BKI_SHARED_RELATION
  37. {
  38. /*
  39. * Identification of the dependent (referencing) object.
  40. *
  41. * Note that dbid can be zero to denote a shared object.
  42. */
  43. Oid dbid BKI_LOOKUP_OPT(pg_database); /* OID of database
  44. * containing object */
  45. Oid classid BKI_LOOKUP(pg_class); /* OID of table containing
  46. * object */
  47. Oid objid; /* OID of object itself */
  48. int32 objsubid; /* column number, or 0 if not used */
  49. /*
  50. * Identification of the independent (referenced) object. This is always
  51. * a shared object, so we need no database ID field. We don't bother with
  52. * a sub-object ID either.
  53. */
  54. Oid refclassid BKI_LOOKUP(pg_class); /* OID of table containing
  55. * object */
  56. Oid refobjid; /* OID of object itself */
  57. /*
  58. * Precise semantics of the relationship are specified by the deptype
  59. * field. See SharedDependencyType in catalog/dependency.h.
  60. */
  61. char deptype; /* see codes in dependency.h */
  62. } FormData_pg_shdepend;
  63. /* ----------------
  64. * Form_pg_shdepend corresponds to a pointer to a row with
  65. * the format of pg_shdepend relation.
  66. * ----------------
  67. */
  68. typedef FormData_pg_shdepend *Form_pg_shdepend;
  69. DECLARE_INDEX(pg_shdepend_depender_index, 1232, SharedDependDependerIndexId, on pg_shdepend using btree(dbid oid_ops, classid oid_ops, objid oid_ops, objsubid int4_ops));
  70. DECLARE_INDEX(pg_shdepend_reference_index, 1233, SharedDependReferenceIndexId, on pg_shdepend using btree(refclassid oid_ops, refobjid oid_ops));
  71. #endif /* PG_SHDEPEND_H */