1 /*-------------------------------------------------------------------------
2  *
3  * pg_shdepend.h
4  *	  definition of the "shared dependency" system catalog (pg_shdepend)
5  *
6  * pg_shdepend has no preloaded contents, so there is no pg_shdepend.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_shdepend;
11  * for example, there's not much value in creating an explicit dependency
12  * from a relation to its database.  Currently, only dependencies on roles
13  * are explicitly stored in pg_shdepend.
14  *
15  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
16  * Portions Copyright (c) 1994, Regents of the University of California
17  *
18  * src/include/catalog/pg_shdepend.h
19  *
20  * NOTES
21  *	  The Catalog.pm module reads this file and derives schema
22  *	  information.
23  *
24  *-------------------------------------------------------------------------
25  */
26 #ifndef PG_SHDEPEND_H
27 #define PG_SHDEPEND_H
28 
29 #include "catalog/genbki.h"
30 #include "catalog/pg_shdepend_d.h"
31 
32 /* ----------------
33  *		pg_shdepend definition.  cpp turns this into
34  *		typedef struct FormData_pg_shdepend
35  * ----------------
36  */
37 CATALOG(pg_shdepend,1214,SharedDependRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
38 {
39 	/*
40 	 * Identification of the dependent (referencing) object.
41 	 *
42 	 * These fields are all zeroes for a DEPENDENCY_PIN entry.  Also, dbid can
43 	 * be zero to denote a shared object.
44 	 */
45 	Oid			dbid;			/* OID of database containing object */
46 	Oid			classid;		/* OID of table containing object */
47 	Oid			objid;			/* OID of object itself */
48 	int32		objsubid;		/* column number, or 0 if not used */
49 
50 	/*
51 	 * Identification of the independent (referenced) object.  This is always
52 	 * a shared object, so we need no database ID field.  We don't bother with
53 	 * a sub-object ID either.
54 	 */
55 	Oid			refclassid;		/* OID of table containing object */
56 	Oid			refobjid;		/* OID of object itself */
57 
58 	/*
59 	 * Precise semantics of the relationship are specified by the deptype
60 	 * field.  See SharedDependencyType in catalog/dependency.h.
61 	 */
62 	char		deptype;		/* see codes in dependency.h */
63 } FormData_pg_shdepend;
64 
65 /* ----------------
66  *		Form_pg_shdepend corresponds to a pointer to a row with
67  *		the format of pg_shdepend relation.
68  * ----------------
69  */
70 typedef FormData_pg_shdepend *Form_pg_shdepend;
71 
72 #endif							/* PG_SHDEPEND_H */
73