pg_inherits.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_inherits.h
  4. * definition of the "inherits" system catalog (pg_inherits)
  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_inherits.h
  11. *
  12. * NOTES
  13. * The Catalog.pm module reads this file and derives schema
  14. * information.
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #ifndef PG_INHERITS_H
  19. #define PG_INHERITS_H
  20. #include "catalog/genbki.h"
  21. #include "catalog/pg_inherits_d.h"
  22. #include "nodes/pg_list.h"
  23. #include "storage/lock.h"
  24. /* ----------------
  25. * pg_inherits definition. cpp turns this into
  26. * typedef struct FormData_pg_inherits
  27. * ----------------
  28. */
  29. CATALOG(pg_inherits,2611,InheritsRelationId)
  30. {
  31. Oid inhrelid BKI_LOOKUP(pg_class);
  32. Oid inhparent BKI_LOOKUP(pg_class);
  33. int32 inhseqno;
  34. bool inhdetachpending;
  35. } FormData_pg_inherits;
  36. /* ----------------
  37. * Form_pg_inherits corresponds to a pointer to a tuple with
  38. * the format of pg_inherits relation.
  39. * ----------------
  40. */
  41. typedef FormData_pg_inherits *Form_pg_inherits;
  42. DECLARE_UNIQUE_INDEX_PKEY(pg_inherits_relid_seqno_index, 2680, InheritsRelidSeqnoIndexId, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops));
  43. DECLARE_INDEX(pg_inherits_parent_index, 2187, InheritsParentIndexId, on pg_inherits using btree(inhparent oid_ops));
  44. extern List *find_inheritance_children(Oid parentrelId, LOCKMODE lockmode);
  45. extern List *find_inheritance_children_extended(Oid parentrelId, bool omit_detached,
  46. LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin);
  47. extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
  48. List **parents);
  49. extern bool has_subclass(Oid relationId);
  50. extern bool has_superclass(Oid relationId);
  51. extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
  52. extern void StoreSingleInheritance(Oid relationId, Oid parentOid,
  53. int32 seqNumber);
  54. extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached,
  55. const char *childname);
  56. extern bool PartitionHasPendingDetach(Oid partoid);
  57. #endif /* PG_INHERITS_H */