pg_depend.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_depend.h
  4. * definition of the system "dependency" relation (pg_depend)
  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_depend.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_DEPEND_H
  20. #define PG_DEPEND_H
  21. #include "catalog/genbki.h"
  22. /* ----------------
  23. * pg_depend definition. cpp turns this into
  24. * typedef struct FormData_pg_depend
  25. * ----------------
  26. */
  27. #define DependRelationId 2608
  28. CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS
  29. {
  30. /*
  31. * Identification of the dependent (referencing) object.
  32. *
  33. * These fields are all zeroes for a DEPENDENCY_PIN entry.
  34. */
  35. Oid classid; /* OID of table containing object */
  36. Oid objid; /* OID of object itself */
  37. int32 objsubid; /* column number, or 0 if not used */
  38. /*
  39. * Identification of the independent (referenced) object.
  40. */
  41. Oid refclassid; /* OID of table containing object */
  42. Oid refobjid; /* OID of object itself */
  43. int32 refobjsubid; /* column number, or 0 if not used */
  44. /*
  45. * Precise semantics of the relationship are specified by the deptype
  46. * field. See DependencyType in catalog/dependency.h.
  47. */
  48. char deptype; /* see codes in dependency.h */
  49. } FormData_pg_depend;
  50. /* ----------------
  51. * Form_pg_depend corresponds to a pointer to a row with
  52. * the format of pg_depend relation.
  53. * ----------------
  54. */
  55. typedef FormData_pg_depend *Form_pg_depend;
  56. /* ----------------
  57. * compiler constants for pg_depend
  58. * ----------------
  59. */
  60. #define Natts_pg_depend 7
  61. #define Anum_pg_depend_classid 1
  62. #define Anum_pg_depend_objid 2
  63. #define Anum_pg_depend_objsubid 3
  64. #define Anum_pg_depend_refclassid 4
  65. #define Anum_pg_depend_refobjid 5
  66. #define Anum_pg_depend_refobjsubid 6
  67. #define Anum_pg_depend_deptype 7
  68. /*
  69. * pg_depend has no preloaded contents; system-defined dependencies are
  70. * loaded into it during a late stage of the initdb process.
  71. *
  72. * NOTE: we do not represent all possible dependency pairs in pg_depend;
  73. * for example, there's not much value in creating an explicit dependency
  74. * from an attribute to its relation. Usually we make a dependency for
  75. * cases where the relationship is conditional rather than essential
  76. * (for example, not all triggers are dependent on constraints, but all
  77. * attributes are dependent on relations) or where the dependency is not
  78. * convenient to find from the contents of other catalogs.
  79. */
  80. #endif /* PG_DEPEND_H */