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; 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-2024, 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 
34 #include "catalog/genbki.h"
35 #include "catalog/pg_depend_d.h"
36 
37 /* ----------------
38  * pg_depend definition. cpp turns this into
39  * typedef struct FormData_pg_depend
40  * ----------------
41  */
42 CATALOG(pg_depend,2608,DependRelationId)
43 {
44  /*
45  * Identification of the dependent (referencing) object.
46  */
47  Oid classid BKI_LOOKUP(pg_class); /* OID of table containing
48  * object */
49  Oid objid; /* OID of object itself */
50  int32 objsubid; /* column number, or 0 if not used */
51 
52  /*
53  * Identification of the independent (referenced) object.
54  */
55  Oid refclassid BKI_LOOKUP(pg_class); /* OID of table containing
56  * object */
57  Oid refobjid; /* OID of object itself */
58  int32 refobjsubid; /* column number, or 0 if not used */
59 
60  /*
61  * Precise semantics of the relationship are specified by the deptype
62  * field. See DependencyType in catalog/dependency.h.
63  */
64  char deptype; /* see codes in dependency.h */
66 
67 /* ----------------
68  * Form_pg_depend corresponds to a pointer to a row with
69  * the format of pg_depend relation.
70  * ----------------
71  */
73 
74 DECLARE_INDEX(pg_depend_depender_index, 2673, DependDependerIndexId, pg_depend, btree(classid oid_ops, objid oid_ops, objsubid int4_ops));
75 DECLARE_INDEX(pg_depend_reference_index, 2674, DependReferenceIndexId, pg_depend, btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops));
76 
77 #endif /* PG_DEPEND_H */
signed int int32
Definition: c.h:481
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
DECLARE_INDEX(pg_depend_depender_index, 2673, DependDependerIndexId, pg_depend, btree(classid oid_ops, objid oid_ops, objsubid int4_ops))
FormData_pg_depend
Definition: pg_depend.h:65
CATALOG(pg_depend, 2608, DependRelationId)
Definition: pg_depend.h:42
FormData_pg_depend * Form_pg_depend
Definition: pg_depend.h:72
unsigned int Oid
Definition: postgres_ext.h:31