PostgreSQL Source Code  git master
pg_depend.h
Go to the documentation of this file.
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; system-defined dependencies are loaded into it during a late stage
8  * of the initdb process.
9  *
10  * NOTE: we do not represent all possible dependency pairs in pg_depend;
11  * for example, there's not much value in creating an explicit dependency
12  * from an attribute to its relation. Usually we make a dependency for
13  * cases where the relationship is conditional rather than essential
14  * (for example, not all triggers are dependent on constraints, but all
15  * attributes are dependent on relations) or where the dependency is not
16  * convenient to find from the contents of other catalogs.
17  *
18  *
19  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
20  * Portions Copyright (c) 1994, Regents of the University of California
21  *
22  * src/include/catalog/pg_depend.h
23  *
24  * NOTES
25  * The Catalog.pm module reads this file and derives schema
26  * information.
27  *
28  *-------------------------------------------------------------------------
29  */
30 #ifndef PG_DEPEND_H
31 #define PG_DEPEND_H
32 
33 #include "catalog/genbki.h"
34 #include "catalog/pg_depend_d.h"
35 
36 /* ----------------
37  * pg_depend definition. cpp turns this into
38  * typedef struct FormData_pg_depend
39  * ----------------
40  */
41 CATALOG(pg_depend,2608,DependRelationId)
42 {
43  /*
44  * Identification of the dependent (referencing) object.
45  *
46  * These fields are all zeroes for a DEPENDENCY_PIN entry.
47  */
48  Oid classid BKI_LOOKUP_OPT(pg_class); /* OID of table containing
49  * object */
50  Oid objid; /* OID of object itself */
51  int32 objsubid; /* column number, or 0 if not used */
52 
53  /*
54  * Identification of the independent (referenced) object.
55  */
56  Oid refclassid BKI_LOOKUP(pg_class); /* OID of table containing
57  * object */
58  Oid refobjid; /* OID of object itself */
59  int32 refobjsubid; /* column number, or 0 if not used */
60 
61  /*
62  * Precise semantics of the relationship are specified by the deptype
63  * field. See DependencyType in catalog/dependency.h.
64  */
65  char deptype; /* see codes in dependency.h */
67 
68 /* ----------------
69  * Form_pg_depend corresponds to a pointer to a row with
70  * the format of pg_depend relation.
71  * ----------------
72  */
74 
75 DECLARE_INDEX(pg_depend_depender_index, 2673, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops));
76 #define DependDependerIndexId 2673
77 DECLARE_INDEX(pg_depend_reference_index, 2674, on pg_depend using btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops));
78 #define DependReferenceIndexId 2674
79 
80 #endif /* PG_DEPEND_H */
DECLARE_INDEX(pg_depend_depender_index, 2673, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops))
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:429
CATALOG(pg_depend, 2608, DependRelationId)
Definition: pg_depend.h:41
FormData_pg_depend * Form_pg_depend
Definition: pg_depend.h:73
#define BKI_LOOKUP_OPT(catalog)
Definition: genbki.h:47
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
FormData_pg_depend
Definition: pg_depend.h:66