00001 /*------------------------------------------------------------------------- 00002 * 00003 * pg_shdepend.h 00004 * definition of the system "shared dependency" relation (pg_shdepend) 00005 * along with the relation's initial contents. 00006 * 00007 * 00008 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00009 * Portions Copyright (c) 1994, Regents of the University of California 00010 * 00011 * src/include/catalog/pg_shdepend.h 00012 * 00013 * NOTES 00014 * the genbki.pl script reads this file and generates .bki 00015 * information from the DATA() statements. 00016 * 00017 *------------------------------------------------------------------------- 00018 */ 00019 #ifndef PG_SHDEPEND_H 00020 #define PG_SHDEPEND_H 00021 00022 #include "catalog/genbki.h" 00023 00024 /* ---------------- 00025 * pg_shdepend definition. cpp turns this into 00026 * typedef struct FormData_pg_shdepend 00027 * ---------------- 00028 */ 00029 #define SharedDependRelationId 1214 00030 00031 CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS 00032 { 00033 /* 00034 * Identification of the dependent (referencing) object. 00035 * 00036 * These fields are all zeroes for a DEPENDENCY_PIN entry. Also, dbid can 00037 * be zero to denote a shared object. 00038 */ 00039 Oid dbid; /* OID of database containing object */ 00040 Oid classid; /* OID of table containing object */ 00041 Oid objid; /* OID of object itself */ 00042 int32 objsubid; /* column number, or 0 if not used */ 00043 00044 /* 00045 * Identification of the independent (referenced) object. This is always 00046 * a shared object, so we need no database ID field. We don't bother with 00047 * a sub-object ID either. 00048 */ 00049 Oid refclassid; /* OID of table containing object */ 00050 Oid refobjid; /* OID of object itself */ 00051 00052 /* 00053 * Precise semantics of the relationship are specified by the deptype 00054 * field. See SharedDependencyType in catalog/dependency.h. 00055 */ 00056 char deptype; /* see codes in dependency.h */ 00057 } FormData_pg_shdepend; 00058 00059 /* ---------------- 00060 * Form_pg_shdepend corresponds to a pointer to a row with 00061 * the format of pg_shdepend relation. 00062 * ---------------- 00063 */ 00064 typedef FormData_pg_shdepend *Form_pg_shdepend; 00065 00066 /* ---------------- 00067 * compiler constants for pg_shdepend 00068 * ---------------- 00069 */ 00070 #define Natts_pg_shdepend 7 00071 #define Anum_pg_shdepend_dbid 1 00072 #define Anum_pg_shdepend_classid 2 00073 #define Anum_pg_shdepend_objid 3 00074 #define Anum_pg_shdepend_objsubid 4 00075 #define Anum_pg_shdepend_refclassid 5 00076 #define Anum_pg_shdepend_refobjid 6 00077 #define Anum_pg_shdepend_deptype 7 00078 00079 00080 /* 00081 * pg_shdepend has no preloaded contents; system-defined dependencies are 00082 * loaded into it during a late stage of the initdb process. 00083 * 00084 * NOTE: we do not represent all possible dependency pairs in pg_shdepend; 00085 * for example, there's not much value in creating an explicit dependency 00086 * from a relation to its database. Currently, only dependencies on roles 00087 * are explicitly stored in pg_shdepend. 00088 */ 00089 00090 #endif /* PG_SHDEPEND_H */