1 /*-------------------------------------------------------------------------
2  *
3  * pg_depend.h
4  *	  definition of the system "dependency" relation (pg_depend)
5  *	  along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * src/include/catalog/pg_depend.h
12  *
13  * NOTES
14  *	  the genbki.pl script reads this file and generates .bki
15  *	  information from the DATA() statements.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PG_DEPEND_H
20 #define PG_DEPEND_H
21 
22 #include "catalog/genbki.h"
23 
24 /* ----------------
25  *		pg_depend definition.  cpp turns this into
26  *		typedef struct FormData_pg_depend
27  * ----------------
28  */
29 #define DependRelationId  2608
30 
31 CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS
32 {
33 	/*
34 	 * Identification of the dependent (referencing) object.
35 	 *
36 	 * These fields are all zeroes for a DEPENDENCY_PIN entry.
37 	 */
38 	Oid			classid;		/* OID of table containing object */
39 	Oid			objid;			/* OID of object itself */
40 	int32		objsubid;		/* column number, or 0 if not used */
41 
42 	/*
43 	 * Identification of the independent (referenced) object.
44 	 */
45 	Oid			refclassid;		/* OID of table containing object */
46 	Oid			refobjid;		/* OID of object itself */
47 	int32		refobjsubid;	/* column number, or 0 if not used */
48 
49 	/*
50 	 * Precise semantics of the relationship are specified by the deptype
51 	 * field.  See DependencyType in catalog/dependency.h.
52 	 */
53 	char		deptype;		/* see codes in dependency.h */
54 } FormData_pg_depend;
55 
56 /* ----------------
57  *		Form_pg_depend corresponds to a pointer to a row with
58  *		the format of pg_depend relation.
59  * ----------------
60  */
61 typedef FormData_pg_depend *Form_pg_depend;
62 
63 /* ----------------
64  *		compiler constants for pg_depend
65  * ----------------
66  */
67 #define Natts_pg_depend				7
68 #define Anum_pg_depend_classid		1
69 #define Anum_pg_depend_objid		2
70 #define Anum_pg_depend_objsubid		3
71 #define Anum_pg_depend_refclassid	4
72 #define Anum_pg_depend_refobjid		5
73 #define Anum_pg_depend_refobjsubid	6
74 #define Anum_pg_depend_deptype		7
75 
76 
77 /*
78  * pg_depend has no preloaded contents; system-defined dependencies are
79  * loaded into it during a late stage of the initdb process.
80  *
81  * NOTE: we do not represent all possible dependency pairs in pg_depend;
82  * for example, there's not much value in creating an explicit dependency
83  * from an attribute to its relation.  Usually we make a dependency for
84  * cases where the relationship is conditional rather than essential
85  * (for example, not all triggers are dependent on constraints, but all
86  * attributes are dependent on relations) or where the dependency is not
87  * convenient to find from the contents of other catalogs.
88  */
89 
90 #endif							/* PG_DEPEND_H */
91