Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > bab02a23fa9f3df8d66a9a3231b50245 > files > 56

postgresql8.3-docs-8.3.6-2mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>pg_class</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.3.6 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="System Catalogs"
HREF="catalogs.html"><LINK
REL="PREVIOUS"
TITLE="pg_cast"
HREF="catalog-pg-cast.html"><LINK
REL="NEXT"
TITLE="pg_constraint"
HREF="catalog-pg-constraint.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="2009-02-03T04:34:16"></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.3.6 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="catalog-pg-cast.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 44. 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-constraint.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CATALOG-PG-CLASS"
>44.12. <TT
CLASS="STRUCTNAME"
>pg_class</TT
></A
></H1
><A
NAME="AEN69053"
></A
><P
>   The catalog <TT
CLASS="STRUCTNAME"
>pg_class</TT
> catalogs tables and most
   everything else that has columns or is otherwise similar to a
   table.  This includes indexes (but see also
   <TT
CLASS="STRUCTNAME"
>pg_index</TT
>), sequences, views, composite types,
   and TOAST tables; see <TT
CLASS="STRUCTFIELD"
>relkind</TT
>.
   Below, when we mean all of these
   kinds of objects we speak of <SPAN
CLASS="QUOTE"
>"relations"</SPAN
>.  Not all
   columns are meaningful for all relation types.
  </P
><DIV
CLASS="TABLE"
><A
NAME="AEN69060"
></A
><P
><B
>Table 44-12. <TT
CLASS="STRUCTNAME"
>pg_class</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"
>relname</TT
></TD
><TD
><TT
CLASS="TYPE"
>name</TT
></TD
><TD
>&nbsp;</TD
><TD
>Name of the table, index, view, etc.</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relnamespace</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-namespace.html"
><TT
CLASS="STRUCTNAME"
>pg_namespace</TT
></A
>.oid</TT
></TD
><TD
>       The OID of the namespace that contains this relation
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltype</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-type.html"
><TT
CLASS="STRUCTNAME"
>pg_type</TT
></A
>.oid</TT
></TD
><TD
>       The OID of the data type that corresponds to this table's row type,
       if any (zero for indexes, which have no <TT
CLASS="STRUCTNAME"
>pg_type</TT
> entry)
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relowner</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-authid.html"
><TT
CLASS="STRUCTNAME"
>pg_authid</TT
></A
>.oid</TT
></TD
><TD
>Owner of the relation</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relam</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-am.html"
><TT
CLASS="STRUCTNAME"
>pg_am</TT
></A
>.oid</TT
></TD
><TD
>If this is an index, the access method used (B-tree, hash, etc.)</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relfilenode</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
>&nbsp;</TD
><TD
>Name of the on-disk file of this relation; 0 if none</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltablespace</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-tablespace.html"
><TT
CLASS="STRUCTNAME"
>pg_tablespace</TT
></A
>.oid</TT
></TD
><TD
>       The tablespace in which this relation is stored.  If zero,
       the database's default tablespace is implied.  (Not meaningful
       if the relation has no on-disk file.)
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relpages</TT
></TD
><TD
><TT
CLASS="TYPE"
>int4</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Size of the on-disk representation of this table in pages (of size
       <TT
CLASS="SYMBOL"
>BLCKSZ</TT
>).  This is only an estimate used by the
       planner.  It is updated by <TT
CLASS="COMMAND"
>VACUUM</TT
>,
       <TT
CLASS="COMMAND"
>ANALYZE</TT
>, and a few DDL commands such as
       <TT
CLASS="COMMAND"
>CREATE INDEX</TT
>
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltuples</TT
></TD
><TD
><TT
CLASS="TYPE"
>float4</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Number of rows in the table.  This is only an estimate used by the
       planner.  It is updated by <TT
CLASS="COMMAND"
>VACUUM</TT
>,
       <TT
CLASS="COMMAND"
>ANALYZE</TT
>, and a few DDL commands such as
       <TT
CLASS="COMMAND"
>CREATE INDEX</TT
>
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltoastrelid</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
>       OID of the TOAST table associated with this table, 0 if none.  The
       TOAST table stores large attributes <SPAN
CLASS="QUOTE"
>"out of line"</SPAN
> in a
       secondary table
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltoastidxid</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
>       For a TOAST table, the OID of its index.  0 if not a TOAST table
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relhasindex</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>       True if this is a table and it has (or recently had) any
       indexes. This is set by <TT
CLASS="COMMAND"
>CREATE INDEX</TT
>, but
       not cleared immediately by <TT
CLASS="COMMAND"
>DROP INDEX</TT
>.
       <TT
CLASS="COMMAND"
>VACUUM</TT
> clears <TT
CLASS="STRUCTFIELD"
>relhasindex</TT
> if it finds the
       table has no indexes
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relisshared</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>       True if this table is shared across all databases in the cluster.  Only
       certain system catalogs (such as <TT
CLASS="STRUCTNAME"
>pg_database</TT
>)
       are shared
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relkind</TT
></TD
><TD
><TT
CLASS="TYPE"
>char</TT
></TD
><TD
>&nbsp;</TD
><TD
>       <TT
CLASS="LITERAL"
>r</TT
> = ordinary table, <TT
CLASS="LITERAL"
>i</TT
> = index,
       <TT
CLASS="LITERAL"
>S</TT
> = sequence, <TT
CLASS="LITERAL"
>v</TT
> = view, <TT
CLASS="LITERAL"
>c</TT
> =
       composite type, <TT
CLASS="LITERAL"
>t</TT
> = TOAST
       table
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relnatts</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Number of user columns in the relation (system columns not
       counted).  There must be this many corresponding entries in
       <TT
CLASS="STRUCTNAME"
>pg_attribute</TT
>.  See also
       <TT
CLASS="LITERAL"
>pg_attribute.attnum</TT
>
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relchecks</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Number of check constraints on the table; see
       <A
HREF="catalog-pg-constraint.html"
><TT
CLASS="STRUCTNAME"
>pg_constraint</TT
></A
> catalog
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reltriggers</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Number of triggers on the table; see
       <A
HREF="catalog-pg-trigger.html"
><TT
CLASS="STRUCTNAME"
>pg_trigger</TT
></A
> catalog
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relukeys</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>Unused  (<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>not</I
></SPAN
> the number of unique keys)</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relfkeys</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>Unused  (<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>not</I
></SPAN
> the number of foreign keys on the table)</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relrefs</TT
></TD
><TD
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
>&nbsp;</TD
><TD
>Unused</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relhasoids</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>       True if we generate an OID for each row of the relation
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relhaspkey</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>       True if the table has (or once had) a primary key
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relhasrules</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>       True if table has rules; see
       <A
HREF="catalog-pg-rewrite.html"
><TT
CLASS="STRUCTNAME"
>pg_rewrite</TT
></A
> catalog
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relhassubclass</TT
></TD
><TD
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
>&nbsp;</TD
><TD
>True if table has (or once had) any inheritance children</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relfrozenxid</TT
></TD
><TD
><TT
CLASS="TYPE"
>xid</TT
></TD
><TD
>&nbsp;</TD
><TD
>       All transaction IDs before this one have been replaced with a permanent
       (<SPAN
CLASS="QUOTE"
>"frozen"</SPAN
>) transaction ID in this table.  This is used to track
       whether the table needs to be vacuumed in order to prevent transaction
       ID wraparound or to allow <TT
CLASS="LITERAL"
>pg_clog</TT
> to be shrunk.  Zero
       (<TT
CLASS="SYMBOL"
>InvalidTransactionId</TT
>) if the relation is not a table
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>relacl</TT
></TD
><TD
><TT
CLASS="TYPE"
>aclitem[]</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Access privileges; see
       <A
HREF="sql-grant.html"
><I
>GRANT</I
></A
> and
       <A
HREF="sql-revoke.html"
><I
>REVOKE</I
></A
>
       for details
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>reloptions</TT
></TD
><TD
><TT
CLASS="TYPE"
>text[]</TT
></TD
><TD
>&nbsp;</TD
><TD
>       Access-method-specific options, as <SPAN
CLASS="QUOTE"
>"keyword=value"</SPAN
> strings
      </TD
></TR
></TBODY
></TABLE
></DIV
></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-cast.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-constraint.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><TT
CLASS="STRUCTNAME"
>pg_cast</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_constraint</TT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>