pg_shdepend.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_shdepend.h
  4. * definition of the system "shared dependency" relation (pg_shdepend)
  5. * along with the relation's initial contents.
  6. *
  7. *
  8. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  9. * Portions Copyright (c) 1994, Regents of the University of California
  10. *
  11. * src/include/catalog/pg_shdepend.h
  12. *
  13. * NOTES
  14. * the genbki.pl script reads this file and generates .bki
  15. * information from the DATA() statements.
  16. *
  17. *-------------------------------------------------------------------------
  18. */
  19. #ifndef PG_SHDEPEND_H
  20. #define PG_SHDEPEND_H
  21. #include "catalog/genbki.h"
  22. /* ----------------
  23. * pg_shdepend definition. cpp turns this into
  24. * typedef struct FormData_pg_shdepend
  25. * ----------------
  26. */
  27. #define SharedDependRelationId 1214
  28. CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
  29. {
  30. /*
  31. * Identification of the dependent (referencing) object.
  32. *
  33. * These fields are all zeroes for a DEPENDENCY_PIN entry. Also, dbid can
  34. * be zero to denote a shared object.
  35. */
  36. Oid dbid; /* OID of database containing object */
  37. Oid classid; /* OID of table containing object */
  38. Oid objid; /* OID of object itself */
  39. int32 objsubid; /* column number, or 0 if not used */
  40. /*
  41. * Identification of the independent (referenced) object. This is always
  42. * a shared object, so we need no database ID field. We don't bother with
  43. * a sub-object ID either.
  44. */
  45. Oid refclassid; /* OID of table containing object */
  46. Oid refobjid; /* OID of object itself */
  47. /*
  48. * Precise semantics of the relationship are specified by the deptype
  49. * field. See SharedDependencyType in catalog/dependency.h.
  50. */
  51. char deptype; /* see codes in dependency.h */
  52. } FormData_pg_shdepend;
  53. /* ----------------
  54. * Form_pg_shdepend corresponds to a pointer to a row with
  55. * the format of pg_shdepend relation.
  56. * ----------------
  57. */
  58. typedef FormData_pg_shdepend *Form_pg_shdepend;
  59. /* ----------------
  60. * compiler constants for pg_shdepend
  61. * ----------------
  62. */
  63. #define Natts_pg_shdepend 7
  64. #define Anum_pg_shdepend_dbid 1
  65. #define Anum_pg_shdepend_classid 2
  66. #define Anum_pg_shdepend_objid 3
  67. #define Anum_pg_shdepend_objsubid 4
  68. #define Anum_pg_shdepend_refclassid 5
  69. #define Anum_pg_shdepend_refobjid 6
  70. #define Anum_pg_shdepend_deptype 7
  71. /*
  72. * pg_shdepend has no preloaded contents; system-defined dependencies are
  73. * loaded into it during a late stage of the initdb process.
  74. *
  75. * NOTE: we do not represent all possible dependency pairs in pg_shdepend;
  76. * for example, there's not much value in creating an explicit dependency
  77. * from a relation to its database. Currently, only dependencies on roles
  78. * are explicitly stored in pg_shdepend.
  79. */
  80. #endif /* PG_SHDEPEND_H */