PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pg_shdepend.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_shdepend.h
4  * definition of the system "shared dependency" relation (pg_shdepend)
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_shdepend.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_SHDEPEND_H
20 #define PG_SHDEPEND_H
21 
22 #include "catalog/genbki.h"
23 
24 /* ----------------
25  * pg_shdepend definition. cpp turns this into
26  * typedef struct FormData_pg_shdepend
27  * ----------------
28  */
29 #define SharedDependRelationId 1214
30 
32 {
33  /*
34  * Identification of the dependent (referencing) object.
35  *
36  * These fields are all zeroes for a DEPENDENCY_PIN entry. Also, dbid can
37  * be zero to denote a shared object.
38  */
39  Oid dbid; /* OID of database containing object */
40  Oid classid; /* OID of table containing object */
41  Oid objid; /* OID of object itself */
42  int32 objsubid; /* column number, or 0 if not used */
43 
44  /*
45  * Identification of the independent (referenced) object. This is always
46  * a shared object, so we need no database ID field. We don't bother with
47  * a sub-object ID either.
48  */
49  Oid refclassid; /* OID of table containing object */
50  Oid refobjid; /* OID of object itself */
51 
52  /*
53  * Precise semantics of the relationship are specified by the deptype
54  * field. See SharedDependencyType in catalog/dependency.h.
55  */
56  char deptype; /* see codes in dependency.h */
58 
59 /* ----------------
60  * Form_pg_shdepend corresponds to a pointer to a row with
61  * the format of pg_shdepend relation.
62  * ----------------
63  */
65 
66 /* ----------------
67  * compiler constants for pg_shdepend
68  * ----------------
69  */
70 #define Natts_pg_shdepend 7
71 #define Anum_pg_shdepend_dbid 1
72 #define Anum_pg_shdepend_classid 2
73 #define Anum_pg_shdepend_objid 3
74 #define Anum_pg_shdepend_objsubid 4
75 #define Anum_pg_shdepend_refclassid 5
76 #define Anum_pg_shdepend_refobjid 6
77 #define Anum_pg_shdepend_deptype 7
78 
79 
80 /*
81  * pg_shdepend has no preloaded contents; system-defined dependencies are
82  * loaded into it during a late stage of the initdb process.
83  *
84  * NOTE: we do not represent all possible dependency pairs in pg_shdepend;
85  * for example, there's not much value in creating an explicit dependency
86  * from a relation to its database. Currently, only dependencies on roles
87  * are explicitly stored in pg_shdepend.
88  */
89 
90 #endif /* PG_SHDEPEND_H */
#define BKI_SHARED_RELATION
Definition: genbki.h:27
FormData_pg_shdepend * Form_pg_shdepend
Definition: pg_shdepend.h:64
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:253
#define BKI_WITHOUT_OIDS
Definition: genbki.h:28
FormData_pg_shdepend
Definition: pg_shdepend.h:57
CATALOG(pg_shdepend, 1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
Definition: pg_shdepend.h:31