pg_depend.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_depend.h
  4. * definition of the "dependency" system catalog (pg_depend)
  5. *
  6. * pg_depend has no preloaded contents, so there is no pg_depend.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_depend.
  10. *
  11. * NOTE: we do not represent all possible dependency pairs in pg_depend;
  12. * for example, there's not much value in creating an explicit dependency
  13. * from an attribute to its relation. Usually we make a dependency for
  14. * cases where the relationship is conditional rather than essential
  15. * (for example, not all triggers are dependent on constraints, but all
  16. * attributes are dependent on relations) or where the dependency is not
  17. * convenient to find from the contents of other catalogs.
  18. *
  19. *
  20. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  21. * Portions Copyright (c) 1994, Regents of the University of California
  22. *
  23. * src/include/catalog/pg_depend.h
  24. *
  25. * NOTES
  26. * The Catalog.pm module reads this file and derives schema
  27. * information.
  28. *
  29. *-------------------------------------------------------------------------
  30. */
  31. #ifndef PG_DEPEND_H
  32. #define PG_DEPEND_H
  33. #include "catalog/genbki.h"
  34. #include "catalog/pg_depend_d.h"
  35. /* ----------------
  36. * pg_depend definition. cpp turns this into
  37. * typedef struct FormData_pg_depend
  38. * ----------------
  39. */
  40. CATALOG(pg_depend,2608,DependRelationId)
  41. {
  42. /*
  43. * Identification of the dependent (referencing) object.
  44. */
  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.
  51. */
  52. Oid refclassid BKI_LOOKUP(pg_class); /* OID of table containing
  53. * object */
  54. Oid refobjid; /* OID of object itself */
  55. int32 refobjsubid; /* column number, or 0 if not used */
  56. /*
  57. * Precise semantics of the relationship are specified by the deptype
  58. * field. See DependencyType in catalog/dependency.h.
  59. */
  60. char deptype; /* see codes in dependency.h */
  61. } FormData_pg_depend;
  62. /* ----------------
  63. * Form_pg_depend corresponds to a pointer to a row with
  64. * the format of pg_depend relation.
  65. * ----------------
  66. */
  67. typedef FormData_pg_depend *Form_pg_depend;
  68. DECLARE_INDEX(pg_depend_depender_index, 2673, DependDependerIndexId, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops));
  69. DECLARE_INDEX(pg_depend_reference_index, 2674, DependReferenceIndexId, on pg_depend using btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops));
  70. #endif /* PG_DEPEND_H */