<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >pg_depend</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REV="MADE" HREF="mailto:pgsql-docs@postgresql.org"><LINK REL="HOME" TITLE="PostgreSQL 8.0.11 Documentation" HREF="index.html"><LINK REL="UP" TITLE="System Catalogs" HREF="catalogs.html"><LINK REL="PREVIOUS" TITLE="pg_database" HREF="catalog-pg-database.html"><LINK REL="NEXT" TITLE="pg_description" HREF="catalog-pg-description.html"><LINK REL="STYLESHEET" TYPE="text/css" HREF="stylesheet.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><META NAME="creation" CONTENT="2007-02-02T03:57:22"></HEAD ><BODY CLASS="SECT1" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="5" ALIGN="center" VALIGN="bottom" >PostgreSQL 8.0.11 Documentation</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A HREF="catalog-pg-database.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A HREF="catalogs.html" >Fast Backward</A ></TD ><TD WIDTH="60%" ALIGN="center" VALIGN="bottom" >Chapter 41. System Catalogs</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="top" ><A HREF="catalogs.html" >Fast Forward</A ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="top" ><A HREF="catalog-pg-description.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="CATALOG-PG-DEPEND" >41.13. <TT CLASS="STRUCTNAME" >pg_depend</TT ></A ></H1 ><A NAME="AEN53289" ></A ><P > The catalog <TT CLASS="STRUCTNAME" >pg_depend</TT > records the dependency relationships between database objects. This information allows <TT CLASS="COMMAND" >DROP</TT > commands to find which other objects must be dropped by <TT CLASS="COMMAND" >DROP CASCADE</TT > or prevent dropping in the <TT CLASS="COMMAND" >DROP RESTRICT</TT > case. </P ><DIV CLASS="TABLE" ><A NAME="AEN53296" ></A ><P ><B >Table 41-13. <TT CLASS="STRUCTNAME" >pg_depend</TT > Columns</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Type</TH ><TH >References</TH ><TH >Description</TH ></TR ></THEAD ><TBODY ><TR ><TD ><TT CLASS="STRUCTFIELD" >classid</TT ></TD ><TD ><TT CLASS="TYPE" >oid</TT ></TD ><TD ><TT CLASS="LITERAL" ><A HREF="catalog-pg-class.html" ><TT CLASS="STRUCTNAME" >pg_class</TT ></A >.oid</TT ></TD ><TD >The OID of the system catalog the dependent object is in</TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >objid</TT ></TD ><TD ><TT CLASS="TYPE" >oid</TT ></TD ><TD >any OID column</TD ><TD >The OID of the specific dependent object</TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >objsubid</TT ></TD ><TD ><TT CLASS="TYPE" >int4</TT ></TD ><TD > </TD ><TD > For a table column, this is the column number (the <TT CLASS="STRUCTFIELD" >objid</TT > and <TT CLASS="STRUCTFIELD" >classid</TT > refer to the table itself). For all other object types, this column is zero. </TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >refclassid</TT ></TD ><TD ><TT CLASS="TYPE" >oid</TT ></TD ><TD ><TT CLASS="LITERAL" ><A HREF="catalog-pg-class.html" ><TT CLASS="STRUCTNAME" >pg_class</TT ></A >.oid</TT ></TD ><TD >The OID of the system catalog the referenced object is in</TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >refobjid</TT ></TD ><TD ><TT CLASS="TYPE" >oid</TT ></TD ><TD >any OID column</TD ><TD >The OID of the specific referenced object</TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >refobjsubid</TT ></TD ><TD ><TT CLASS="TYPE" >int4</TT ></TD ><TD > </TD ><TD > For a table column, this is the column number (the <TT CLASS="STRUCTFIELD" >refobjid</TT > and <TT CLASS="STRUCTFIELD" >refclassid</TT > refer to the table itself). For all other object types, this column is zero. </TD ></TR ><TR ><TD ><TT CLASS="STRUCTFIELD" >deptype</TT ></TD ><TD ><TT CLASS="TYPE" >char</TT ></TD ><TD > </TD ><TD > A code defining the specific semantics of this dependency relationship; see text. </TD ></TR ></TBODY ></TABLE ></DIV ><P > In all cases, a <TT CLASS="STRUCTNAME" >pg_depend</TT > entry indicates that the referenced object may not be dropped without also dropping the dependent object. However, there are several subflavors identified by <TT CLASS="STRUCTFIELD" >deptype</TT >: <P ></P ></P><DIV CLASS="VARIABLELIST" ><DL ><DT ><TT CLASS="SYMBOL" >DEPENDENCY_NORMAL</TT > (<TT CLASS="LITERAL" >n</TT >)</DT ><DD ><P > A normal relationship between separately-created objects. The dependent object may be dropped without affecting the referenced object. The referenced object may only be dropped by specifying <TT CLASS="LITERAL" >CASCADE</TT >, in which case the dependent object is dropped, too. Example: a table column has a normal dependency on its data type. </P ></DD ><DT ><TT CLASS="SYMBOL" >DEPENDENCY_AUTO</TT > (<TT CLASS="LITERAL" >a</TT >)</DT ><DD ><P > The dependent object can be dropped separately from the referenced object, and should be automatically dropped (regardless of <TT CLASS="LITERAL" >RESTRICT</TT > or <TT CLASS="LITERAL" >CASCADE</TT > mode) if the referenced object is dropped. Example: a named constraint on a table is made autodependent on the table, so that it will go away if the table is dropped. </P ></DD ><DT ><TT CLASS="SYMBOL" >DEPENDENCY_INTERNAL</TT > (<TT CLASS="LITERAL" >i</TT >)</DT ><DD ><P > The dependent object was created as part of creation of the referenced object, and is really just a part of its internal implementation. A <TT CLASS="COMMAND" >DROP</TT > of the dependent object will be disallowed outright (we'll tell the user to issue a <TT CLASS="COMMAND" >DROP</TT > against the referenced object, instead). A <TT CLASS="COMMAND" >DROP</TT > of the referenced object will be propagated through to drop the dependent object whether <TT CLASS="COMMAND" >CASCADE</TT > is specified or not. Example: a trigger that's created to enforce a foreign-key constraint is made internally dependent on the constraint's <TT CLASS="STRUCTNAME" >pg_constraint</TT > entry. </P ></DD ><DT ><TT CLASS="SYMBOL" >DEPENDENCY_PIN</TT > (<TT CLASS="LITERAL" >p</TT >)</DT ><DD ><P > There is no dependent object; this type of entry is a signal that the system itself depends on the referenced object, and so that object must never be deleted. Entries of this type are created only by <TT CLASS="COMMAND" >initdb</TT >. The columns for the dependent object contain zeroes. </P ></DD ></DL ></DIV ><P> Other dependency flavors may be needed in future. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="catalog-pg-database.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="catalog-pg-description.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><TT CLASS="STRUCTNAME" >pg_database</TT ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="catalogs.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><TT CLASS="STRUCTNAME" >pg_description</TT ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >