Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > c87b2b497674629a1400410f06a9ef63 > files > 46

postgresql-docs-7.3.2-5mdk.ppc.rpm

<HTML
><HEAD
><TITLE
>pg_class</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 7.3.2 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
NAME="creation"
CONTENT="2003-02-03T20:17:34"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PostgreSQL 7.3.2 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="catalog-pg-cast.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. System Catalogs</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><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"
>3.9. pg_class</A
></H1
><P
>   <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, and some
   kinds of special relation; 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
   fields are meaningful for all relation types.
  </P
><DIV
CLASS="TABLE"
><A
NAME="AEN52886"
></A
><P
><B
>Table 3-9. pg_class Columns</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Name</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Type</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>References</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relname</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>name</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Name of the table, index, view, etc.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relnamespace</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_namespace.oid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       The OID of the namespace that contains this relation
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>reltype</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_type.oid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       The OID of the data type that corresponds to this table, if any
       (zero for indexes, which have no pg_type entry)
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relowner</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int4</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_shadow.usesysid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Owner of the relation</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relam</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_am.oid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>If this is an index, the access method used (B-tree, hash, etc.)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relfilenode</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Name of the on-disk file of this relation; 0 if none</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relpages</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int4</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       Size of the on-disk representation of this table in pages (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 <TT
CLASS="COMMAND"
>CREATE INDEX</TT
>.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>reltuples</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>float4</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       Number of tuples 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 <TT
CLASS="COMMAND"
>CREATE INDEX</TT
>.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>reltoastrelid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_class.oid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       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
ALIGN="LEFT"
VALIGN="TOP"
>reltoastidxid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>pg_class.oid</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       For a TOAST table, the OID of its index.  0 if not a TOAST table.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relhasindex</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>True if this is a table and it has (or recently had) any indexes.
       This is set by CREATE INDEX, but not cleared immediately by DROP INDEX.
       VACUUM clears relhasindex if it finds the table has no indexes.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relisshared</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>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
ALIGN="LEFT"
VALIGN="TOP"
>relkind</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>char</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
       'c' = composite type, 's' = special, 't' = TOAST table
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relnatts</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       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="STRUCTNAME"
>pg_attribute</TT
>.<TT
CLASS="STRUCTFIELD"
>attnum</TT
>.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relchecks</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       Number of check constraints on the table; see
       <TT
CLASS="STRUCTNAME"
>pg_constraint</TT
> catalog
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>reltriggers</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       Number of triggers on the table; see
       <TT
CLASS="STRUCTNAME"
>pg_trigger</TT
> catalog
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relukeys</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>unused  (<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Not</I
></SPAN
> the number of unique keys)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relfkeys</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>unused  (<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Not</I
></SPAN
> the number of foreign keys on the table)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relrefs</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>int2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>unused</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relhasoids</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       True if we generate an OID for each row of the relation.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relhaspkey</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       True if the table has (or once had) a primary key.
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relhasrules</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Table has rules; see
       <TT
CLASS="STRUCTNAME"
>pg_rewrite</TT
> catalog
      </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relhassubclass</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>bool</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>At least one table inherits from this one</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>relacl</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="TYPE"
>aclitem[]</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>       Access permissions.  See the descriptions of
       <TT
CLASS="COMMAND"
>GRANT</TT
> and <TT
CLASS="COMMAND"
>REVOKE</TT
> for
       details.
      </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"
>pg_cast</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="catalogs.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>pg_constraint</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>