| 1 | /*------------------------------------------------------------------------- |
| 2 | * |
| 3 | * pg_inherits.h |
| 4 | * definition of the "inherits" system catalog (pg_inherits) |
| 5 | * |
| 6 | * |
| 7 | * Portions Copyright (c) 1996-2019, 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 | |
| 21 | #include "catalog/genbki.h" |
| 22 | #include "catalog/pg_inherits_d.h" |
| 23 | |
| 24 | #include "nodes/pg_list.h" |
| 25 | #include "storage/lock.h" |
| 26 | |
| 27 | /* ---------------- |
| 28 | * pg_inherits definition. cpp turns this into |
| 29 | * typedef struct FormData_pg_inherits |
| 30 | * ---------------- |
| 31 | */ |
| 32 | CATALOG(pg_inherits,2611,InheritsRelationId) |
| 33 | { |
| 34 | Oid inhrelid; |
| 35 | Oid inhparent; |
| 36 | int32 inhseqno; |
| 37 | } FormData_pg_inherits; |
| 38 | |
| 39 | /* ---------------- |
| 40 | * Form_pg_inherits corresponds to a pointer to a tuple with |
| 41 | * the format of pg_inherits relation. |
| 42 | * ---------------- |
| 43 | */ |
| 44 | typedef FormData_pg_inherits *Form_pg_inherits; |
| 45 | |
| 46 | |
| 47 | extern List *find_inheritance_children(Oid parentrelId, LOCKMODE lockmode); |
| 48 | extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, |
| 49 | List **parents); |
| 50 | extern bool has_subclass(Oid relationId); |
| 51 | extern bool has_superclass(Oid relationId); |
| 52 | extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); |
| 53 | extern void StoreSingleInheritance(Oid relationId, Oid parentOid, |
| 54 | int32 seqNumber); |
| 55 | extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent); |
| 56 | |
| 57 | #endif /* PG_INHERITS_H */ |
| 58 | |