/*------------------------------------------------------------------------- * * pg_depend.h * definition of the system "depend" relation (pg_depend) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * $Header$ * * NOTES * the genbki.sh script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_DEPEND_H #define PG_DEPEND_H /* ---------------- * postgres.h contains the system type definitions and the * CATALOG(), BOOTSTRAP and DATA() sugar words so this file * can be read by both genbki.sh and the C compiler. * ---------------- */ /* ---------------- * pg_depend definition. cpp turns this into * typedef struct FormData_pg_depend * ---------------- */ CATALOG(pg_depend) BOOTSTRAP BKI_WITHOUT_OIDS { Oid classid; /* OID of table containing object */ Oid objid; /* OID of object itself */ int4 objsubid; /* column number, or 0 if not used */ Oid depclassid; /* OID of table containing dependee object */ Oid depobjid; /* OID of dependee object itself */ int4 depobjsubid; /* dependee column number, or 0 if not used */ /* * Always cascade to the item, even when the RESTRICT behavior has been * specified. Used primarily for SERIAL, and ARRAY types. */ bool alwayscascade; } FormData_pg_depend; /* ---------------- * Form_pg_depend corresponds to a pointer to a row with * the format of pg_depend relation. * ---------------- */ typedef FormData_pg_depend *Form_pg_depend; /* ---------------- * compiler constants for pg_depend * ---------------- */ #define Natts_pg_depend 7 #define Anum_pg_depend_classid 1 #define Anum_pg_depend_objid 2 #define Anum_pg_depend_objsubid 3 #define Anum_pg_depend_depclassid 4 #define Anum_pg_depend_depobjid 5 #define Anum_pg_depend_depobjsubid 6 #define Anum_pg_depend_alwayscascade 7 /* * This table would go through OIDs like a knife through hot butter, * so lets avoid them altogether. * * Possible dependencies we don't store are: */ /* ---------------- * pg_type depends on Functions * ---------------- */ //DATA(insert ( 1262 19 0 123 19 0 f)); /* ---------------- * pg_type depends on SubTypes (arrays) * ---------------- */ /* ---------------- * pg_type depends on Complex Types (table types) * ---------------- */ /* ---------------- * pg_attribute depends on Types * ---------------- */ /* ---------------- * pg_attribute depends on pg_class * ---------------- */ /* ---------------- * pg_class depends on Complex Types (table types) * ---------------- */ /* ---------------- * pg_class depends on index access methods (pg_am) * ---------------- */ /* ---------------- * more... * ---------------- */ typedef struct ObjectAddress { Oid classId; /* Class Id from pg_class */ Oid objectId; /* OID of the object */ int32 objectSubId; /* Subitem within the object (column of table) */ } ObjectAddress; extern void dependCreate(const ObjectAddress *depender, const ObjectAddress *dependee, bool behavior); extern void dependDelete(ObjectAddress *object, int behavior); extern void dependDeleteTuple(const HeapTuple tup, const Relation relation, int behavior); #endif /* PG_DEPEND_H */