2000-11-29 21:15:59 +01:00
|
|
|
<!--
|
|
|
|
Documentation of the system catalogs, directed toward PostgreSQL developers
|
2003-11-01 02:56:29 +01:00
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.77 2003/11/01 01:56:28 petere Exp $
|
2000-11-29 21:15:59 +01:00
|
|
|
-->
|
|
|
|
|
|
|
|
<chapter id="catalogs">
|
|
|
|
<title>System Catalogs</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The system catalogs are the place where a relational database
|
|
|
|
management system stores schema metadata, such as information about
|
|
|
|
tables and columns, and internal bookkeeping information.
|
|
|
|
<productname>PostgreSQL</productname>'s system catalogs are regular
|
|
|
|
tables. You can drop and recreate the tables, add columns, insert
|
|
|
|
and update values, and severely mess up your system that way.
|
2003-04-15 15:23:35 +02:00
|
|
|
Normally, one should not change the system catalogs by hand, there
|
2000-11-29 21:15:59 +01:00
|
|
|
are always SQL commands to do that. (For example, <command>CREATE
|
|
|
|
DATABASE</command> inserts a row into the
|
2003-04-15 15:23:35 +02:00
|
|
|
<structname>pg_database</structname> catalog --- and actually
|
2000-11-29 21:15:59 +01:00
|
|
|
creates the database on disk.) There are some exceptions for
|
2003-04-15 15:23:35 +02:00
|
|
|
particularly esoteric operations, such as adding index access methods.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<sect1 id="catalogs-overview">
|
|
|
|
<title>Overview</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="catalog-table"> lists the system catalogs.
|
|
|
|
More detailed documentation of each catalog follows below.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
2003-04-15 15:23:35 +02:00
|
|
|
|
2002-10-14 06:29:23 +02:00
|
|
|
<para>
|
|
|
|
Most system catalogs are copied from the template database during
|
2003-04-15 15:23:35 +02:00
|
|
|
database creation and are thereafter database-specific. A few
|
|
|
|
catalogs are physically shared across all databases in a cluster;
|
2002-10-14 06:29:23 +02:00
|
|
|
these are marked in the descriptions of the individual catalogs.
|
|
|
|
</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2003-04-15 15:23:35 +02:00
|
|
|
<table id="catalog-table">
|
2000-11-29 21:15:59 +01:00
|
|
|
<title>System Catalogs</title>
|
|
|
|
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Catalog Name</entry>
|
|
|
|
<entry>Purpose</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-aggregate"><structname>pg_aggregate</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>aggregate functions</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-am"><structname>pg_am</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>index access methods</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-amop"><structname>pg_amop</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>access method operators</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>access method support procedures</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>column default values</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link></entry>
|
|
|
|
<entry>table columns (<quote>attributes</quote>)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-cast"><structname>pg_cast</structname></link></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>casts (data type conversions)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-class"><structname>pg_class</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>tables, indexes, sequences (<quote>relations</quote>)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link></entry>
|
|
|
|
<entry>check constraints, unique constraints, primary key constraints, foreign key constraints</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-conversion"><structname>pg_conversion</structname></link></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>encoding conversion information</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-database"><structname>pg_database</structname></link></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>databases within this database cluster</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-depend"><structname>pg_depend</structname></link></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>dependencies between database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-description"><structname>pg_description</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>descriptions or comments on database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-group"><structname>pg_group</structname></link></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>groups of database users</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-index"><structname>pg_index</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>additional index information</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-inherits"><structname>pg_inherits</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>table inheritance hierarchy</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-language"><structname>pg_language</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>languages for writing functions</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-largeobject"><structname>pg_largeobject</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>large objects</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-listener"><structname>pg_listener</structname></link></entry>
|
|
|
|
<entry>asynchronous notification support</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-03-22 22:34:44 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link></entry>
|
|
|
|
<entry>schemas</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>index access method operator classes</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>operators</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>functions and procedures</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link></entry>
|
|
|
|
<entry>query rewrite rules</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>database users</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link></entry>
|
|
|
|
<entry>planner statistics</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>triggers</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-type"><structname>pg_type</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>data types</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-aggregate">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_aggregate</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-aggregate">
|
|
|
|
<primary>pg_aggregate</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_aggregate</structname> stores information about
|
2000-11-29 21:15:59 +01:00
|
|
|
aggregate functions. An aggregate function is a function that
|
2001-05-07 02:43:27 +02:00
|
|
|
operates on a set of values (typically one column from each row
|
2000-11-29 21:15:59 +01:00
|
|
|
that matches a query condition) and returns a single value computed
|
|
|
|
from all these values. Typical aggregate functions are
|
|
|
|
<function>sum</function>, <function>count</function>, and
|
2002-04-11 22:00:18 +02:00
|
|
|
<function>max</function>. Each entry in
|
|
|
|
<structname>pg_aggregate</structname> is an extension of an entry
|
|
|
|
in <structname>pg_proc</structname>. The <structname>pg_proc</structname>
|
2003-04-15 15:23:35 +02:00
|
|
|
entry carries the aggregate's name, input and output data types, and
|
2002-04-11 22:00:18 +02:00
|
|
|
other information that is similar to ordinary functions.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_aggregate</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggfnoid</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structname>pg_proc</structname> OID of the aggregate function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggtransfn</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Transition function</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggfinalfn</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Final function (zero if none)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggtranstype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The type of the aggregate function's internal transition (state) data</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>agginitval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The initial value of the transition state. This is a text
|
2001-09-06 04:07:42 +02:00
|
|
|
field containing the initial value in its external string
|
2003-04-15 15:23:35 +02:00
|
|
|
representation. If the value is null, the transition state
|
|
|
|
value starts out null.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
New aggregate functions are registered with the <command>CREATE
|
2003-03-25 17:15:44 +01:00
|
|
|
AGGREGATE</command> command. See <xref linkend="xaggr"> for more
|
2003-01-19 01:13:31 +01:00
|
|
|
information about writing aggregate functions and the meaning of
|
|
|
|
the transition functions, etc.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<sect1 id="catalog-pg-am">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_am</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-am">
|
|
|
|
<primary>pg_am</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_am</structname> stores information about index access
|
2002-07-30 07:24:56 +02:00
|
|
|
methods. There is one row for each index access method supported by
|
|
|
|
the system.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_am</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amname</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Name of the access method</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amowner</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>User ID of the owner (currently not used)</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amstrategies</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Number of operator strategies for this access method</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amsupport</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Number of support routines for this access method</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amorderstrategy</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Zero if the index offers no sort order, otherwise the strategy
|
2002-07-30 07:24:56 +02:00
|
|
|
number of the strategy operator that describes the sort order</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amcanunique</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Does the access method support unique indexes?</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amcanmulticol</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Does the access method support multicolumn indexes?</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amindexnulls</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Does the access method support null index entries?</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amconcurrent</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Does the access method support concurrent updates?</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amgettuple</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Next valid tuple</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aminsert</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Insert this tuple</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ambeginscan</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Start new scan</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amrescan</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Restart this scan</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amendscan</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>End this scan</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ammarkpos</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Mark current scan position</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amrestrpos</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Restore marked scan position</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ambuild</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><quote>Build new index</quote> function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ambulkdelete</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Bulk-delete function</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2003-02-22 01:45:05 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amvacuumcleanup</structfield></entry>
|
2003-02-22 01:45:05 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Post-<command>VACUUM</command> cleanup function</entry>
|
2003-02-22 01:45:05 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amcostestimate</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Function to estimate cost of an index scan</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
An index access method that supports multiple columns (has
|
2002-07-30 07:24:56 +02:00
|
|
|
<structfield>amcanmulticol</structfield> true) <emphasis>must</>
|
2003-04-15 15:23:35 +02:00
|
|
|
support indexing null values in columns after the first, because the planner
|
2002-07-30 07:24:56 +02:00
|
|
|
will assume the index can be used for queries on just the first
|
2003-04-15 15:23:35 +02:00
|
|
|
column(s). For example, consider an index on (a,b) and a query with
|
|
|
|
<literal>WHERE a = 4</literal>. The system will assume the index can be used to scan for
|
|
|
|
rows with <literal>a = 4</literal>, which is wrong if the index omits rows where <literal>b</> is null.
|
|
|
|
It is, however, OK to omit rows where the first indexed column is null.
|
2002-07-30 07:24:56 +02:00
|
|
|
(GiST currently does so.)
|
|
|
|
<structfield>amindexnulls</structfield> should be set true only if the
|
2003-04-15 15:23:35 +02:00
|
|
|
index access method indexes all rows, including arbitrary combinations of null values.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-amop">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amop</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-amop">
|
|
|
|
<primary>pg_amop</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_amop</structname> stores information about operators
|
2002-07-30 07:24:56 +02:00
|
|
|
associated with index access method operator classes. There is one
|
|
|
|
row for each operator that is a member of an operator class.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amop</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopclaid</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The index operator class this entry is for</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopstrategy</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Operator strategy number</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopreqcheck</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Index hit must be rechecked</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopopr</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>OID of the operator</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-amproc">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amproc</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-amproc">
|
|
|
|
<primary>pg_amproc</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_amproc</structname> stores information about support
|
2002-07-30 07:24:56 +02:00
|
|
|
procedures
|
|
|
|
associated with index access method operator classes. There is one
|
|
|
|
row for each support procedure belonging to an operator class.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amproc</structname> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopclaid</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The index operator class this entry is for</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amprocnum</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Support procedure number</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amproc</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>OID of the procedure</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-attrdef">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attrdef</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-attrdef">
|
|
|
|
<primary>pg_attrdef</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_attrdef</structname> stores column default values. The main information
|
2000-11-29 21:15:59 +01:00
|
|
|
about columns is stored in <structname>pg_attribute</structname>
|
|
|
|
(see below). Only columns that explicitly specify a default value
|
|
|
|
(when the table is created or the column is added) will have an
|
|
|
|
entry here.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attrdef</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The table this column belongs to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adnum</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>The number of the column</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adbin</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The internal representation of the column default value</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adsrc</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A human-readable representation of the default value</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-attribute">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attribute</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-attribute">
|
|
|
|
<primary>pg_attribute</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_attribute</structname> stores information about
|
2000-11-29 21:15:59 +01:00
|
|
|
table columns. There will be exactly one
|
|
|
|
<structname>pg_attribute</structname> row for every column in every
|
|
|
|
table in the database. (There will also be attribute entries for
|
|
|
|
indexes and other objects. See <structname>pg_class</structname>.)
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The term attribute is equivalent to column and is used for
|
|
|
|
historical reasons.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attribute</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The table this column belongs to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The column name</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atttypid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The data type of this column</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attstattarget</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<structfield>attstattarget</structfield> controls the level of detail
|
|
|
|
of statistics accumulated for this column by
|
|
|
|
<command>ANALYZE</command>.
|
|
|
|
A zero value indicates that no statistics should be collected.
|
2002-07-31 19:19:54 +02:00
|
|
|
A negative value says to use the system default statistics target.
|
2003-04-15 15:23:35 +02:00
|
|
|
The exact meaning of positive values is data type-dependent.
|
|
|
|
For scalar data types, <structfield>attstattarget</structfield>
|
2001-05-07 02:43:27 +02:00
|
|
|
is both the target number of <quote>most common values</quote>
|
|
|
|
to collect, and the target number of histogram bins to create.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attlen</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typlen</literal> of this column's
|
|
|
|
type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attnum</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The number of the column. Ordinary columns are numbered from 1
|
|
|
|
up. System columns, such as <structfield>oid</structfield>,
|
|
|
|
have (arbitrary) negative numbers.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attndims</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>
|
2001-11-03 22:42:47 +01:00
|
|
|
Number of dimensions, if the column is an array type; otherwise 0.
|
|
|
|
(Presently, the number of dimensions of an array is not enforced,
|
|
|
|
so any nonzero value effectively means <quote>it's an array</>.)
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attcacheoff</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
Always -1 in storage, but when loaded into a row descriptor
|
2001-10-16 00:47:47 +02:00
|
|
|
in memory this may be updated to cache the offset of the attribute
|
2003-11-01 02:56:29 +01:00
|
|
|
within the row.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atttypmod</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>atttypmod</structfield> records type-specific data
|
|
|
|
supplied at table creation time (for example, the maximum
|
|
|
|
length of a <type>varchar</type> column). It is passed to
|
2002-09-24 23:26:44 +02:00
|
|
|
type-specific input functions and length coercion functions.
|
2003-04-15 15:23:35 +02:00
|
|
|
The value will generally be -1 for types that do not need <structfield>atttypmod</>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attbyval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typbyval</> of this column's type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attstorage</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
Normally a copy of <literal>pg_type.typstorage</> of this
|
|
|
|
column's type. For TOAST-able data types, this can be altered
|
2002-09-24 23:26:44 +02:00
|
|
|
after column creation to control storage policy.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attisset</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If true, this attribute is a set. In that case, what is really
|
2003-11-01 02:56:29 +01:00
|
|
|
stored in the attribute is the OID of a row in the
|
2000-11-29 21:15:59 +01:00
|
|
|
<structname>pg_proc</structname> catalog. The
|
2003-11-01 02:56:29 +01:00
|
|
|
<structname>pg_proc</structname> row contains the query
|
2003-04-15 15:23:35 +02:00
|
|
|
string that defines this set, i.e., the query to run to get
|
2000-11-29 21:15:59 +01:00
|
|
|
the set. So the <structfield>atttypid</structfield> (see
|
|
|
|
above) refers to the type returned by this query, but the
|
|
|
|
actual length of this attribute is the length (size) of an
|
|
|
|
<type>oid</type>. --- At least this is the theory. All this
|
|
|
|
is probably quite broken these days.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attalign</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typalign</> of this column's type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attnotnull</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
This represents a not-null constraint. It is possible to
|
|
|
|
change this column to enable or disable the constraint.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atthasdef</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This column has a default value, in which case there will be a
|
|
|
|
corresponding entry in the <structname>pg_attrdef</structname>
|
|
|
|
catalog that actually defines the value.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-08-02 20:15:10 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attisdropped</structfield></entry>
|
2002-08-02 20:15:10 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This column has been dropped and is no longer valid. A dropped
|
|
|
|
column is still physically present in the table, but is
|
|
|
|
ignored by the parser and so cannot be accessed via SQL.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-08-30 21:23:20 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attislocal</structfield></entry>
|
2002-08-30 21:23:20 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2002-09-22 21:42:52 +02:00
|
|
|
This column is defined locally in the relation. Note that a column may
|
|
|
|
be locally defined and inherited simultaneously.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attinhcount</structfield></entry>
|
2002-09-22 21:42:52 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The number of direct ancestors this column has. A column with a
|
|
|
|
nonzero number of ancestors cannot be dropped nor renamed.
|
2002-08-30 21:23:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<sect1 id="catalog-pg-cast">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_cast</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-cast">
|
|
|
|
<primary>pg_cast</primary>
|
|
|
|
</indexterm>
|
2002-07-22 22:23:19 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_cast</structname> stores data type conversion paths,
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
both built-in paths and those defined with <command>CREATE CAST</command>.
|
2002-07-22 22:23:19 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structfield>pg_cast</> Columns</title>
|
2002-07-22 22:23:19 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castsource</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>OID of the source data type</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>casttarget</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>OID of the target data type</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castfunc</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
The OID of the function to use to perform this cast. Zero is
|
2003-04-15 15:23:35 +02:00
|
|
|
stored if the data types are binary compatible (that is, no
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
run-time operation is needed to perform the cast).
|
2002-07-22 22:23:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castcontext</structfield></entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<entry><type>char</type></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry></entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<entry>
|
|
|
|
Indicates what contexts the cast may be invoked in.
|
|
|
|
<literal>e</> means only as an explicit cast (using
|
|
|
|
<literal>CAST</>, <literal>::</>, or function-call syntax).
|
|
|
|
<literal>a</> means implicitly in assignment
|
|
|
|
to a target column, as well as explicitly.
|
|
|
|
<literal>i</> means implicitly in expressions, as well as the
|
|
|
|
other cases.
|
|
|
|
</entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-class">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_class</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-class">
|
|
|
|
<primary>pg_class</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_class</structname> catalogs tables and most
|
2000-11-29 21:15:59 +01:00
|
|
|
everything else that has columns or is otherwise similar to a
|
2001-08-10 20:57:42 +02:00
|
|
|
table. This includes indexes (but see also
|
2000-11-29 21:15:59 +01:00
|
|
|
<structname>pg_index</structname>), sequences, views, and some
|
2002-08-28 17:02:55 +02:00
|
|
|
kinds of special relation; see <structfield>relkind</>.
|
2002-09-24 23:26:44 +02:00
|
|
|
Below, when we mean all of these
|
2000-11-29 21:15:59 +01:00
|
|
|
kinds of objects we speak of <quote>relations</quote>. Not all
|
2003-04-15 15:23:35 +02:00
|
|
|
columns are meaningful for all relation types.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_class</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the table, index, view, etc.</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-26 20:17:02 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relnamespace</structfield></entry>
|
2002-03-26 20:17:02 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-03-26 20:17:02 +01:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this relation
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
The OID of the data type that corresponds to this table, if any
|
2003-04-15 15:23:35 +02:00
|
|
|
(zero for indexes, which have no <structname>pg_type</> entry)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relowner</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Owner of the relation</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relam</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
2002-03-22 20:20:45 +01:00
|
|
|
<entry>If this is an index, the access method used (B-tree, hash, etc.)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relfilenode</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
2002-08-28 17:02:55 +02:00
|
|
|
<entry>Name of the on-disk file of this relation; 0 if none</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relpages</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Size of the on-disk representation of this table in pages (size
|
2001-05-07 02:43:27 +02:00
|
|
|
<symbol>BLCKSZ</symbol>).
|
|
|
|
This is only an estimate used by the planner.
|
|
|
|
It is updated by <command>VACUUM</command>,
|
|
|
|
<command>ANALYZE</command>, and <command>CREATE INDEX</command>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltuples</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
Number of rows in the table.
|
2001-05-07 02:43:27 +02:00
|
|
|
This is only an estimate used by the planner.
|
|
|
|
It is updated by <command>VACUUM</command>,
|
|
|
|
<command>ANALYZE</command>, and <command>CREATE INDEX</command>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltoastrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2002-03-22 20:20:45 +01:00
|
|
|
OID of the TOAST table associated with this table, 0 if none.
|
2000-11-29 21:15:59 +01:00
|
|
|
The TOAST table stores large attributes <quote>out of
|
|
|
|
line</quote> in a secondary table.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltoastidxid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry>
|
|
|
|
For a TOAST table, the OID of its index. 0 if not a TOAST table.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasindex</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-12-17 18:41:30 +01:00
|
|
|
<entry>
|
|
|
|
True if this is a table and it has (or recently had) any
|
|
|
|
indexes. This is set by <command>CREATE INDEX</command>, but
|
|
|
|
not cleared immediately by <command>DROP INDEX</command>.
|
2003-04-15 15:23:35 +02:00
|
|
|
<command>VACUUM</command> clears <structfield>relhasindex</> if it finds the
|
2002-12-17 18:41:30 +01:00
|
|
|
table has no indexes.
|
2001-08-10 20:57:42 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relisshared</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2001-06-12 07:55:50 +02:00
|
|
|
<entry>True if this table is shared across all databases in the
|
2001-10-16 00:47:47 +02:00
|
|
|
cluster. Only certain system catalogs (such as
|
|
|
|
<structname>pg_database</structname>) are shared.</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relkind</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>r</> = ordinary table, <literal>i</> = index,
|
|
|
|
<literal>S</> = sequence, <literal>v</> = view, <literal>c</> =
|
|
|
|
composite type, <literal>s</> = special, <literal>t</> = TOAST
|
|
|
|
table
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relnatts</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
Number of user columns in the relation (system columns not
|
|
|
|
counted). There must be this many corresponding entries in
|
2000-11-29 21:15:59 +01:00
|
|
|
<structname>pg_attribute</structname>. See also
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_attribute.attnum</literal>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relchecks</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Number of check constraints on the table; see
|
2002-07-12 20:43:19 +02:00
|
|
|
<structname>pg_constraint</structname> catalog
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltriggers</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Number of triggers on the table; see
|
|
|
|
<structname>pg_trigger</structname> catalog
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relukeys</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>unused (<emphasis>not</emphasis> the number of unique keys)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relfkeys</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>unused (<emphasis>not</emphasis> the number of foreign keys on the table)</entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relrefs</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>unused</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasoids</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
True if we generate an OID for each row of the relation.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhaspkey</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
True if the table has (or once had) a primary key.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasrules</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>Table has rules; see
|
|
|
|
<structname>pg_rewrite</structname> catalog
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhassubclass</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry>At least one table inherits from this one</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relacl</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
Access privileges; see the descriptions of
|
2000-11-29 21:15:59 +01:00
|
|
|
<command>GRANT</command> and <command>REVOKE</command> for
|
|
|
|
details.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<sect1 id="catalog-pg-constraint">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_constraint</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-constraint">
|
|
|
|
<primary>pg_constraint</primary>
|
|
|
|
</indexterm>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_constraint</structname> stores check, primary key, unique, and foreign
|
|
|
|
key constraints on tables. (Column constraints are not treated
|
|
|
|
specially. Every column constraint is equivalent to some table
|
|
|
|
constraint.) Not-null constraints are represented in the
|
|
|
|
<structname>pg_attribute</> catalog.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Check constraints on domains are stored here, too.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_constraint</> Columns</title>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conname</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Constraint name (not necessarily unique!)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>connamespace</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this constraint
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>c</> = check constraint,
|
|
|
|
<literal>f</> = foreign key constraint,
|
|
|
|
<literal>p</> = primary key constraint,
|
|
|
|
<literal>u</> = unique constraint
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condeferrable</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>Is the constraint deferrable?</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condeferred</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>Is the constraint deferred by default?</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conrelid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>The table this constraint is on; 0 if not a table constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contypid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>The domain this constraint is on; 0 if not a domain constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confrelid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>If a foreign key, the referenced table; else 0</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confupdtype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Foreign key update action code</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confdeltype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Foreign key deletion action code</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confmatchtype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Foreign key match type</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conkey</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int2[]</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>If a table constraint, list of columns which the constraint constrains</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confkey</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int2[]</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>If a foreign key, list of the referenced columns</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conbin</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If a check constraint, an internal representation of the expression</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>consrc</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If a check constraint, a human-readable representation of the expression</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2003-10-17 02:55:17 +02:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
<structfield>consrc</structfield> is not updated when referenced objects
|
|
|
|
change; for example, it won't track renaming of columns. Rather than
|
|
|
|
relying on this field, it's best to use <function>pg_get_constraintdef()</>
|
|
|
|
to extract the definition of a check constraint.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<note>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.relchecks</literal> needs to agree with the
|
|
|
|
number of check-constraint entries found in this table for the
|
|
|
|
given relation.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<sect1 id="catalog-pg-conversion">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_conversion</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-conversion">
|
|
|
|
<primary>pg_conversion</primary>
|
|
|
|
</indexterm>
|
2002-07-24 07:51:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_conversion</structname> stores encoding conversion information. See
|
2002-07-24 07:51:56 +02:00
|
|
|
<command>CREATE CONVERSION</command> for more information.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_conversion</> Columns</title>
|
2002-07-24 07:51:56 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conname</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Conversion name (unique within a namespace)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>connamespace</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this conversion
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conowner</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the conversion</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conforencoding</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Source encoding ID</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contoencoding</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Destination encoding ID</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conproc</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>Conversion procedure</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condefault</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if this is the default conversion</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-database">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_database</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-database">
|
|
|
|
<primary>pg_database</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_database</structname> stores information
|
2001-10-16 00:47:47 +02:00
|
|
|
about the available databases. Databases are created with the
|
2003-03-25 17:15:44 +01:00
|
|
|
<command>CREATE DATABASE</command> command. Consult
|
|
|
|
<xref linkend="managing-databases"> for details about the meaning of some of the
|
2003-01-19 01:13:31 +01:00
|
|
|
parameters.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_database</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_database</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_database</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Database name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datdba</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Owner of the database, usually the user who created it</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>encoding</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Character encoding for this database</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datistemplate</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If true then this database can be used in the
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>TEMPLATE</literal> clause of <command>CREATE
|
2002-04-21 02:26:44 +02:00
|
|
|
DATABASE</command> to create a new database as a clone of
|
2000-11-29 21:15:59 +01:00
|
|
|
this one.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datallowconn</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If false then no one can connect to this database. This is
|
2003-04-15 15:23:35 +02:00
|
|
|
used to protect the <literal>template0</> database from being altered.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datlastsysoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2001-08-26 18:56:03 +02:00
|
|
|
Last system OID in the database; useful
|
2000-11-29 21:15:59 +01:00
|
|
|
particularly to <application>pg_dump</application>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-08-26 18:56:03 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datvacuumxid</structfield></entry>
|
2001-08-26 18:56:03 +02:00
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
All rows inserted or deleted by transaction IDs before this one
|
2001-08-26 18:56:03 +02:00
|
|
|
have been marked as known committed or known aborted in this database.
|
|
|
|
This is used to determine when commit-log space can be recycled.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datfrozenxid</structfield></entry>
|
2001-08-26 18:56:03 +02:00
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
All rows inserted by transaction IDs before this one have been
|
2001-08-26 18:56:03 +02:00
|
|
|
relabeled with a permanent (<quote>frozen</>) transaction ID in this
|
|
|
|
database. This is useful to check whether a database must be vacuumed
|
2003-04-15 15:23:35 +02:00
|
|
|
soon to avoid transaction ID wrap-around problems.
|
2001-08-26 18:56:03 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datpath</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If the database is stored at an alternative location then this
|
|
|
|
records the location. It's either an environment variable name
|
|
|
|
or an absolute path, depending how it was entered.
|
|
|
|
</entry>
|
|
|
|
</row>
|
2002-03-01 23:45:19 +01:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datconfig</structfield></entry>
|
2002-03-01 23:45:19 +01:00
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Session defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
2002-04-21 02:26:44 +02:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datacl</structfield></entry>
|
2002-04-21 02:26:44 +02:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Access privileges</entry>
|
2002-04-21 02:26:44 +02:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<sect1 id="catalog-pg-depend">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_depend</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-depend">
|
|
|
|
<primary>pg_depend</primary>
|
|
|
|
</indexterm>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_depend</structname> records the dependency
|
2002-07-12 20:43:19 +02:00
|
|
|
relationships between database objects. This information allows
|
|
|
|
<command>DROP</> commands to find which other objects must be dropped
|
2003-04-15 15:23:35 +02:00
|
|
|
by <command>DROP CASCADE</> or prevent dropping in the <command>DROP
|
2002-07-12 20:43:19 +02:00
|
|
|
RESTRICT</> case.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_depend</> Columns</title>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>classid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog the dependent object is in</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the specific dependent object</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a table column, this is the column number (the
|
|
|
|
<structfield>objid</> and <structfield>classid</> refer to the
|
|
|
|
table itself). For all other object types, this column is
|
|
|
|
zero.
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refclassid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog the referenced object is in</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refobjid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry>any OID column</entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the specific referenced object</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refobjsubid</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a table column, this is the column number (the
|
|
|
|
<structfield>refobjid</> and <structfield>refclassid</> refer
|
|
|
|
to the table itself). For all other object types, this column
|
|
|
|
is zero.
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>deptype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A code defining the specific semantics of this dependency relationship; see text.
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In all cases, a <structname>pg_depend</structname> entry indicates that the
|
|
|
|
referenced object may not be dropped without also dropping the dependent
|
|
|
|
object. However, there are several subflavors identified by
|
|
|
|
<structfield>deptype</>:
|
|
|
|
|
2003-04-15 15:23:35 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_NORMAL</> (<literal>n</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
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 <literal>CASCADE</>, in which case the dependent
|
|
|
|
object is dropped, too. Example: a table column has a normal
|
|
|
|
dependency on its data type.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_AUTO</> (<literal>a</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The dependent object can be dropped separately from the
|
|
|
|
referenced object, and should be automatically dropped
|
|
|
|
(regardless of <literal>RESTRICT</> or <literal>CASCADE</>
|
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_INTERNAL</> (<literal>i</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The dependent object was created as part of creation of the
|
|
|
|
referenced object, and is really just a part of its internal
|
|
|
|
implementation. A <command>DROP</> of the dependent object
|
|
|
|
will be disallowed outright (we'll tell the user to issue a
|
|
|
|
<command>DROP</> against the referenced object, instead). A
|
|
|
|
<command>DROP</> of the referenced object will be propagated
|
|
|
|
through to drop the dependent object whether
|
|
|
|
<command>CASCADE</> is specified or not. Example: a trigger
|
|
|
|
that's created to enforce a foreign-key constraint is made
|
|
|
|
internally dependent on the constraint's
|
|
|
|
<structname>pg_constraint</> entry.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_PIN</> (<literal>p</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
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 <command>initdb</command>. The columns for the
|
|
|
|
dependent object contain zeroes.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
Other dependency flavors may be needed in future.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-description">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_description</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-description">
|
|
|
|
<primary>pg_description</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_description</> can store an optional description or
|
2000-11-29 21:15:59 +01:00
|
|
|
comment for each database object. Descriptions can be manipulated
|
2002-09-24 23:26:44 +02:00
|
|
|
with the <command>COMMENT</command> command and viewed with
|
2000-11-29 21:15:59 +01:00
|
|
|
<application>psql</application>'s <literal>\d</literal> commands.
|
2002-09-24 23:26:44 +02:00
|
|
|
Descriptions of many built-in system objects are provided in the initial
|
2003-04-15 15:23:35 +02:00
|
|
|
contents of <structname>pg_description</structname>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_description</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this description pertains to</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2001-08-10 20:57:42 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>classoid</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a comment on a table column, this is the column number (the
|
|
|
|
<structfield>objoid</> and <structfield>classoid</> refer to
|
|
|
|
the table itself). For all other object types, this column is
|
|
|
|
zero.
|
2001-08-10 20:57:42 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>description</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Arbitrary text that serves as the description of this object.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-group">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_group</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-group">
|
|
|
|
<primary>pg_group</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_group</structname> defines groups and stores what users belong to what
|
2000-11-29 21:15:59 +01:00
|
|
|
groups. Groups are created with the <command>CREATE
|
2003-03-25 17:15:44 +01:00
|
|
|
GROUP</command> command. Consult <xref linkend="user-manag"> for information
|
2003-04-15 15:23:35 +02:00
|
|
|
about user privilege management.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
|
|
|
Because user and group identities are cluster-wide,
|
|
|
|
<structname>pg_group</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_group</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_group</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>groname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the group</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>grosysid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>An arbitrary number to identify this group</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>grolist</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4[]</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>An array containing the IDs of the users in this group</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-index">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_index</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-index">
|
|
|
|
<primary>pg_index</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_index</structname> contains part of the information
|
2000-11-29 21:15:59 +01:00
|
|
|
about indexes. The rest is mostly in
|
|
|
|
<structname>pg_class</structname>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_index</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indexrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the <structname>pg_class</> entry for this index</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the <structname>pg_class</> entry for the table this index is for</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indkey</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2vector</type></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
This is an array of <structfield>indnatts</structfield> (up to
|
|
|
|
<symbol>INDEX_MAX_KEYS</symbol>) values that indicate which
|
|
|
|
table columns this index indexes. For example a value of
|
|
|
|
<literal>1 3</literal> would mean that the first and the third table
|
|
|
|
columns make up the index key. A zero in this array indicates that the
|
|
|
|
corresponding index attribute is an expression over the table columns,
|
|
|
|
rather than a simple column reference.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indclass</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oidvector</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
For each column in the index key this contains the OID of
|
2003-04-15 15:23:35 +02:00
|
|
|
the operator class to use. See
|
2000-11-29 21:15:59 +01:00
|
|
|
<structname>pg_opclass</structname> for details.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry><structfield>indnatts</structfield></entry>
|
|
|
|
<entry><type>int2</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry>The number of columns in the index (duplicates
|
|
|
|
<literal>pg_class.relnatts</literal>)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indisunique</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If true, this is a unique index.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indisprimary</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>If true, this index represents the primary key of the table.
|
2003-04-15 15:23:35 +02:00
|
|
|
(<structfield>indisunique</> should always be true when this is true.)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry><structfield>indisclustered</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry>If true, the table was last clustered on this index.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>indexprs</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Expression trees (in <function>nodeToString()</function> representation)
|
|
|
|
for index attributes that are not simple column references. This is a
|
|
|
|
list with one element for each zero entry in <structfield>indkey</>.
|
|
|
|
Null if all index attributes are simple references.</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indpred</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry>Expression tree (in <function>nodeToString()</function> representation)
|
|
|
|
for partial index predicate. Null if not a partial index.</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-inherits">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_inherits</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-inherits">
|
|
|
|
<primary>pg_inherits</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_inherits</> records information about
|
|
|
|
table inheritance hierarchies.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_inherits</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
The OID of the child table.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhparent</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
The OID of the parent table.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhseqno</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
If there is more than one parent for a child table (multiple
|
2000-11-29 21:15:59 +01:00
|
|
|
inheritance), this number tells the order in which the
|
|
|
|
inherited columns are to be arranged. The count starts at 1.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-language">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_language</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-language">
|
|
|
|
<primary>pg_language</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_language</structname> registers call interfaces or
|
2000-11-29 21:15:59 +01:00
|
|
|
languages in which you can write functions or stored procedures.
|
2003-03-25 17:15:44 +01:00
|
|
|
See under <command>CREATE LANGUAGE</command> and in
|
2003-04-15 15:23:35 +02:00
|
|
|
<xref linkend="xplang"> for more information about language handlers.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_language</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the language (to be specified when creating a function)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanispl</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2002-12-17 18:41:30 +01:00
|
|
|
This is false for internal languages (such as
|
|
|
|
<acronym>SQL</acronym>) and true for user-defined languages.
|
|
|
|
Currently, <application>pg_dump</application> still uses this
|
|
|
|
to determine which languages need to be dumped, but this may be
|
|
|
|
replaced by a different mechanism sometime.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanpltrusted</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This is a trusted language. See under <command>CREATE
|
|
|
|
LANGUAGE</command> what this means. If this is an internal
|
|
|
|
language (<structfield>lanispl</structfield> is false) then
|
2003-04-15 15:23:35 +02:00
|
|
|
this column is meaningless.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanplcallfoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
For noninternal languages this references the language
|
2000-11-29 21:15:59 +01:00
|
|
|
handler, which is a special function that is responsible for
|
|
|
|
executing all functions that are written in the particular
|
|
|
|
language.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-06-20 17:44:06 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanvalidator</structfield></entry>
|
2002-06-20 17:44:06 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-06-20 17:44:06 +02:00
|
|
|
<entry>
|
|
|
|
This references a language validator function that is responsible
|
|
|
|
for checking the syntax and validity of new functions when they
|
|
|
|
are created. See under <command>CREATE LANGUAGE</command> for
|
|
|
|
further information about validators.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-02-19 00:11:58 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanacl</structfield></entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Access privileges</entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-largeobject">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_largeobject</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-largeobject">
|
|
|
|
<primary>pg_largeobject</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_largeobject</structname> holds the data making up
|
2001-10-16 00:47:47 +02:00
|
|
|
<quote>large objects</quote>. A large object is identified by an
|
|
|
|
OID assigned when it is created. Each large object is broken into
|
|
|
|
segments or <quote>pages</> small enough to be conveniently stored as rows
|
|
|
|
in <structname>pg_largeobject</structname>.
|
2003-04-15 15:23:35 +02:00
|
|
|
The amount of data per page is defined to be <literal>LOBLKSIZE</> (which is currently
|
|
|
|
<literal>BLCKSZ/4</>, or typically 2 kB).
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_largeobject</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>loid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Identifier of the large object that includes this page</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pageno</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Page number of this page within its large object
|
|
|
|
(counting from zero)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>data</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bytea</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Actual data stored in the large object.
|
2003-04-15 15:23:35 +02:00
|
|
|
This will never be more than <symbol>LOBLKSIZE</> bytes and may be less.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Each row of <structname>pg_largeobject</structname> holds data
|
|
|
|
for one page of a large object, beginning at
|
2003-04-15 15:23:35 +02:00
|
|
|
byte offset (<literal>pageno * LOBLKSIZE</>) within the object. The implementation
|
2001-10-16 00:47:47 +02:00
|
|
|
allows sparse storage: pages may be missing, and may be shorter than
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>LOBLKSIZE</> bytes even if they are not the last page of the object.
|
2001-10-16 00:47:47 +02:00
|
|
|
Missing regions within a large object read as zeroes.
|
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-listener">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_listener</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-listener">
|
|
|
|
<primary>pg_listener</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_listener</structname> supports the <command>LISTEN</>
|
2001-10-16 00:47:47 +02:00
|
|
|
and <command>NOTIFY</> commands. A listener creates an entry in
|
|
|
|
<structname>pg_listener</structname> for each notification name
|
|
|
|
it is listening for. A notifier scans <structname>pg_listener</structname>
|
|
|
|
and updates each matching entry to show that a notification has occurred.
|
|
|
|
The notifier also sends a signal (using the PID recorded in the table)
|
|
|
|
to awaken the listener from sleep.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_listener</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relname</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Notify condition name. (The name need not match any actual
|
2003-04-15 15:23:35 +02:00
|
|
|
relation in the database; the name <structfield>relname</> is historical.)
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>listenerpid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>PID of the server process that created this entry.</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>notification</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Zero if no event is pending for this listener. If an event is
|
2003-04-15 15:23:35 +02:00
|
|
|
pending, the PID of the server process that sent the notification.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
|
2002-03-22 22:34:44 +01:00
|
|
|
<sect1 id="catalog-pg-namespace">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_namespace</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-namespace">
|
|
|
|
<primary>pg_namespace</primary>
|
|
|
|
</indexterm>
|
2002-03-22 22:34:44 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_namespace</> stores namespaces.
|
|
|
|
A namespace is the structure underlying SQL schemas: each namespace
|
|
|
|
can have a separate collection of relations, types, etc. without name
|
2002-03-22 22:34:44 +01:00
|
|
|
conflicts.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_namespace</> Columns</title>
|
2002-03-22 22:34:44 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspname</structfield></entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the namespace</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspowner</structfield></entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the namespace</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspacl</structfield></entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Access privileges</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<sect1 id="catalog-pg-opclass">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_opclass</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-opclass">
|
|
|
|
<primary>pg_opclass</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_opclass</structname> defines
|
2002-07-30 07:24:56 +02:00
|
|
|
index access method operator classes. Each operator class defines
|
2003-04-15 15:23:35 +02:00
|
|
|
semantics for index columns of a particular data type and a particular
|
2002-07-30 07:24:56 +02:00
|
|
|
index access method. Note that there can be multiple operator classes
|
2003-04-15 15:23:35 +02:00
|
|
|
for a given data type/access method combination, thus supporting multiple
|
2002-07-30 07:24:56 +02:00
|
|
|
behaviors.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Operator classes are described at length in <xref linkend="xindex">.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_opclass</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcamid</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry>Index access method operator class is for</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcname</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Name of this operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcnamespace</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Namespace of this operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcowner</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Operator class owner</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcintype</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Input data type of the operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcdefault</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if this operator class is the default for <structfield>opcintype</></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opckeytype</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Type of index data, or zero if same as <structfield>opcintype</></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The majority of the information defining an operator class is actually
|
|
|
|
not in its <structname>pg_opclass</structname> row, but in the associated
|
|
|
|
rows in <structname>pg_amop</structname> and
|
|
|
|
<structname>pg_amproc</structname>. Those rows are considered to be
|
|
|
|
part of the operator class definition --- this is not unlike the way
|
|
|
|
that a relation is defined by a single <structname>pg_class</structname>
|
2003-04-15 15:23:35 +02:00
|
|
|
row plus associated rows in <structname>pg_attribute</structname> and
|
2002-07-30 07:24:56 +02:00
|
|
|
other tables.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-operator">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_operator</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-operator">
|
|
|
|
<primary>pg_operator</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_operator</> stores information about operators. See
|
|
|
|
<command>CREATE OPERATOR</command> and <xref linkend="xoper"> for
|
|
|
|
details on these operator parameters.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_operator</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the operator</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-17 01:08:12 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprnamespace</structfield></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this operator
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprowner</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the operator</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprkind</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>b</> = infix (<quote>both</quote>), <literal>l</> = prefix
|
|
|
|
(<quote>left</quote>), <literal>r</> = postfix (<quote>right</quote>)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcanhash</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-06-23 00:04:55 +02:00
|
|
|
<entry>This operator supports hash joins</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprleft</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the left operand</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprright</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the right operand</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprresult</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the result</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcom</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Commutator of this operator, if any</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprnegate</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-12-11 19:26:37 +01:00
|
|
|
<entry>Negator of this operator, if any</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprlsortop</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
|
|
|
If this operator supports merge joins, the operator that sorts
|
2002-04-17 01:08:12 +02:00
|
|
|
the type of the left-hand operand (<literal>L<L</>)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprrsortop</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
|
|
|
If this operator supports merge joins, the operator that sorts
|
2002-04-17 01:08:12 +02:00
|
|
|
the type of the right-hand operand (<literal>R<R</>)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprltcmpop</structfield></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry>
|
|
|
|
If this operator supports merge joins, the less-than operator that
|
|
|
|
compares the left and right operand types (<literal>L<R</>)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprgtcmpop</structfield></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry>
|
|
|
|
If this operator supports merge joins, the greater-than operator that
|
|
|
|
compares the left and right operand types (<literal>L>R</>)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcode</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Function that implements this operator</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprrest</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Restriction selectivity estimation function for this operator</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprjoin</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Join selectivity estimation function for this operator</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2002-09-24 23:26:44 +02:00
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Unused column contain zeroes, for example <structfield>oprleft</structfield> is zero for a
|
2002-09-24 23:26:44 +02:00
|
|
|
prefix operator.
|
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-proc">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_proc</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-proc">
|
|
|
|
<primary>pg_proc</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_proc</> stores information about functions (or procedures).
|
2003-03-25 17:15:44 +01:00
|
|
|
The description of <command>CREATE FUNCTION</command> and
|
|
|
|
<xref linkend="xfunc"> contain more information about the meaning of
|
2003-04-15 15:23:35 +02:00
|
|
|
some columns.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
<para>
|
|
|
|
The table contains data for aggregate functions as well as plain functions.
|
|
|
|
If <structfield>proisagg</structfield> is true, there should be a matching
|
2003-04-15 15:23:35 +02:00
|
|
|
row in <structfield>pg_aggregate</structfield>.
|
2002-04-11 22:00:18 +02:00
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_proc</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the function</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-05 02:31:36 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pronamespace</structfield></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this function
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proowner</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prolang</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-language"><structname>pg_langauge</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Implementation language or call interface of this function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proisagg</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry>Function is an aggregate function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prosecdef</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Function is a security definer (i.e., a <quote>setuid</>
|
|
|
|
function)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proisstrict</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Function returns null if any call argument is null. In that
|
|
|
|
case the function won't actually be called at all. Functions
|
|
|
|
that are not <quote>strict</quote> must be prepared to handle
|
|
|
|
null inputs.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proretset</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Function returns a set (i.e., multiple values of the specified
|
2002-04-11 22:00:18 +02:00
|
|
|
data type)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-05 02:31:36 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>provolatile</structfield></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>provolatile</structfield> tells whether the function's
|
|
|
|
result depends only on its input arguments, or is affected by outside
|
|
|
|
factors.
|
|
|
|
It is <literal>i</literal> for <quote>immutable</> functions,
|
|
|
|
which always deliver the same result for the same inputs.
|
|
|
|
It is <literal>s</literal> for <quote>stable</> functions,
|
|
|
|
whose results (for fixed inputs) do not change within a scan.
|
|
|
|
It is <literal>v</literal> for <quote>volatile</> functions,
|
|
|
|
whose results may change at any time. (Use <literal>v</literal> also
|
|
|
|
for functions with side-effects, so that calls to them cannot get
|
|
|
|
optimized away.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pronargs</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Number of arguments</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prorettype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Data type of the return value</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proargtypes</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oidvector</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>An array with the data types of the function arguments</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prosrc</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This tells the function handler how to invoke the function. It
|
|
|
|
might be the actual source code of the function for interpreted
|
|
|
|
languages, a link symbol, a file name, or just about anything
|
2001-10-16 00:47:47 +02:00
|
|
|
else, depending on the implementation language/call convention.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>probin</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bytea</type></entry>
|
|
|
|
<entry></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>Additional information about how to invoke the function.
|
|
|
|
Again, the interpretation is language-specific.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
2002-02-19 00:11:58 +01:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proacl</structfield></entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Access privileges</entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>prosrc</structfield> contains the function's C-language
|
|
|
|
name (link symbol) for compiled functions, both built-in and
|
|
|
|
dynamically loaded. For all other language types,
|
|
|
|
<structfield>prosrc</structfield> contains the function's source
|
|
|
|
text. <structfield>probin</structfield> is unused except for
|
|
|
|
dynamically-loaded C functions, for which it gives the name of the
|
|
|
|
shared library file containing the function.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-rewrite">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_rewrite</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-rewrite">
|
|
|
|
<primary>pg_rewrite</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_rewrite</structname> stores rewrite rules for tables and views.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_rewrite</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>rulename</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Rule name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_class</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The table this rule is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_attr</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The column this rule is for (currently, always zero to
|
|
|
|
indicate the whole table)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-09-24 23:26:44 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_type</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Event type that the rule is for: 1 = <command>SELECT</>, 2 =
|
|
|
|
<command>UPDATE</>, 3 = <command>INSERT</>, 4 =
|
|
|
|
<command>DELETE</>
|
|
|
|
</entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
</row>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>is_instead</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if the rule is an <literal>INSTEAD</literal> rule</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_qual</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Expression tree (in the form of a
|
|
|
|
<function>nodeToString()</function> representation) for the
|
|
|
|
rule's qualifying condition
|
|
|
|
</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_action</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Query tree (in the form of a
|
|
|
|
<function>nodeToString()</function> representation) for the
|
|
|
|
rule's action
|
|
|
|
</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.relhasrules</literal>
|
2001-10-16 00:47:47 +02:00
|
|
|
must be true if a table has any rules in this catalog.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-shadow">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_shadow</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-shadow">
|
|
|
|
<primary>pg_shadow</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_shadow</structname> contains information about
|
2000-11-29 21:15:59 +01:00
|
|
|
database users. The name stems from the fact that this table
|
|
|
|
should not be readable by the public since it contains passwords.
|
2003-10-18 00:38:20 +02:00
|
|
|
<link linkend="view-pg-user"><structname>pg_user</structname></link>
|
|
|
|
is a publicly readable view on
|
|
|
|
<structname>pg_shadow</structname> that blanks out the password field.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2003-03-25 17:15:44 +01:00
|
|
|
<xref linkend="user-manag"> contains detailed information about user and
|
2003-04-15 15:23:35 +02:00
|
|
|
privilege management.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
|
|
|
Because user identities are cluster-wide,
|
|
|
|
<structname>pg_shadow</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_shadow</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_shadow</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>usename</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>usesysid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User id (arbitrary number used to reference this user)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>usecreatedb</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User may create databases</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>usesuper</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User is a superuser</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>usecatupd</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
User may update system catalogs. (Even a superuser may not do
|
2003-04-15 15:23:35 +02:00
|
|
|
this unless this column is true.)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>passwd</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Password</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>valuntil</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>abstime</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Account expiry time (only used for password authentication)</entry>
|
|
|
|
</row>
|
2002-03-01 23:45:19 +01:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>useconfig</structfield></entry>
|
2002-03-01 23:45:19 +01:00
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Session defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-statistic">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_statistic</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-statistic">
|
|
|
|
<primary>pg_statistic</primary>
|
|
|
|
</indexterm>
|
2001-05-07 02:43:27 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_statistic</structname> stores statistical data about
|
2001-05-07 02:43:27 +02:00
|
|
|
the contents of the database. Entries are created by
|
|
|
|
<command>ANALYZE</command> and subsequently used by the query planner.
|
|
|
|
There is one entry for each table column that has been analyzed.
|
|
|
|
Note that all the statistical data is inherently approximate,
|
|
|
|
even assuming that it is up-to-date.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Since different kinds of statistics may be appropriate for different
|
|
|
|
kinds of data, <structname>pg_statistic</structname> is designed not
|
|
|
|
to assume very much about what sort of statistics it stores. Only
|
2003-04-15 15:23:35 +02:00
|
|
|
extremely general statistics (such as nullness) are given dedicated
|
2001-05-07 02:43:27 +02:00
|
|
|
columns in <structname>pg_statistic</structname>. Everything else
|
2001-09-13 17:55:24 +02:00
|
|
|
is stored in <quote>slots</quote>, which are groups of associated columns whose
|
2001-05-07 02:43:27 +02:00
|
|
|
content is identified by a code number in one of the slot's columns.
|
|
|
|
For more information see
|
|
|
|
<filename>src/include/catalog/pg_statistic.h</filename>.
|
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
|
|
|
<structname>pg_statistic</structname> should not be readable by the
|
|
|
|
public, since even statistical information about a table's contents
|
|
|
|
may be considered sensitive. (Example: minimum and maximum values
|
|
|
|
of a salary column might be quite interesting.)
|
2003-10-18 00:38:20 +02:00
|
|
|
<link linkend="view-pg-stats"><structname>pg_stats</structname></link>
|
|
|
|
is a publicly readable view on
|
2001-10-16 00:47:47 +02:00
|
|
|
<structname>pg_statistic</structname> that only exposes information
|
|
|
|
about those tables that are readable by the current user.
|
|
|
|
</para>
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_statistic</> Columns</title>
|
2001-05-07 02:43:27 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>starelid</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>The table that the described column belongs to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>staattnum</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int2</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>The number of the described column</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stanullfrac</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The fraction of the column's entries that are null</entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stawidth</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The average stored width, in bytes, of nonnull entries</entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stadistinct</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The number of distinct nonnull data values in the column.
|
2001-05-07 02:43:27 +02:00
|
|
|
A value greater than zero is the actual number of distinct values.
|
|
|
|
A value less than zero is the negative of a fraction of the number
|
|
|
|
of rows in the table (for example, a column in which values appear about
|
2003-04-15 15:23:35 +02:00
|
|
|
twice on the average could be represented by <structfield>stadistinct</> = -0.5).
|
2001-05-07 02:43:27 +02:00
|
|
|
A zero value means the number of distinct values is unknown.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stakind<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
A code number indicating the kind of statistics stored in the
|
|
|
|
<replaceable>N</>th <quote>slot</quote> of the
|
|
|
|
<structname>pg_statistic</structname> row.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>staop<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
An operator used to derive the statistics stored in the
|
|
|
|
<replaceable>N</>th <quote>slot</quote>. For example, a
|
|
|
|
histogram slot would show the <literal><</literal> operator
|
|
|
|
that defines the sort order of the data.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stanumbers<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Numerical statistics of the appropriate kind for the
|
|
|
|
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
|
|
|
kind does not involve numerical values.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stavalues<replaceable>N</></structfield></entry>
|
2003-03-23 06:14:37 +01:00
|
|
|
<entry><type>anyarray</type></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Column data values of the appropriate kind for the
|
|
|
|
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
|
|
|
kind does not store any data values. Each array's element
|
|
|
|
values are actually of the specific column's data type, so there
|
|
|
|
is no way to define these columns' type more specifically than
|
|
|
|
<type>anyarray</>.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-05-07 02:43:27 +02:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-trigger">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_trigger</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-trigger">
|
|
|
|
<primary>pg_trigger</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_trigger</structname> stores triggers on tables. See under
|
2001-10-16 00:47:47 +02:00
|
|
|
<command>CREATE TRIGGER</command> for more information.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_trigger</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgrelid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The table this trigger is on</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgname</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Trigger name (must be unique among triggers of same table)</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgfoid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The function to be called</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgtype</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry>Bit mask identifying trigger conditions</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgenabled</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if trigger is enabled (not presently checked everywhere
|
|
|
|
it should be, so disabling a trigger by setting this false does not
|
|
|
|
work reliably)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgisconstraint</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if trigger implements a referential integrity constraint</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgconstrname</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Referential integrity constraint name</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgconstrrelid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The table referenced by an referential integrity constraint</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgdeferrable</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if deferrable</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tginitdeferred</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if initially deferred</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgnargs</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Number of argument strings passed to trigger function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgattr</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2vector</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Currently unused</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgargs</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bytea</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Argument strings to pass to trigger, each null-terminated</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.reltriggers</literal> needs to match up with the
|
|
|
|
entries in this table.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-type">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_type</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-type">
|
|
|
|
<primary>pg_type</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_type</structname> stores information about data types. Base types
|
|
|
|
(scalar types) are created with <command>CREATE TYPE</command>.
|
2003-05-09 00:19:58 +02:00
|
|
|
A composite type is automatically created for each table in the database, to
|
2002-03-20 20:45:13 +01:00
|
|
|
represent the row structure of the table. It is also possible to create
|
2003-05-09 00:19:58 +02:00
|
|
|
composite types with <command>CREATE TYPE AS</command> and
|
2002-03-20 20:45:13 +01:00
|
|
|
derived types with <command>CREATE DOMAIN</command>.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_type</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Data type name</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-29 20:06:29 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typnamespace</structfield></entry>
|
2002-03-29 20:06:29 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-03-29 20:06:29 +01:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this type
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typowner</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the type</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typlen</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2002-08-24 17:00:47 +02:00
|
|
|
<entry>
|
|
|
|
For a fixed-size type, <structfield>typlen</structfield> is the number
|
|
|
|
of bytes in the internal representation of the type. But for a
|
|
|
|
variable-length type, <structfield>typlen</structfield> is negative.
|
|
|
|
-1 indicates a <quote>varlena</> type (one that has a length word),
|
|
|
|
-2 indicates a null-terminated C string.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typbyval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>typbyval</structfield> determines whether internal
|
|
|
|
routines pass a value of this type by value or by reference.
|
2003-05-09 00:19:58 +02:00
|
|
|
<structfield>typbyval</structfield> had better be false if
|
|
|
|
<structfield>typlen</structfield> is not 1, 2, or 4 (or 8 on machines
|
|
|
|
where Datum is 8 bytes).
|
2000-11-29 21:15:59 +01:00
|
|
|
Variable-length types are always passed by reference. Note that
|
|
|
|
<structfield>typbyval</structfield> can be false even if the
|
|
|
|
length would allow pass-by-value; this is currently true for
|
|
|
|
type <type>float4</type>, for example.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typtype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>typtype</structfield> is <literal>b</literal> for
|
2003-05-09 00:19:58 +02:00
|
|
|
a base type, <literal>c</literal> for a composite type (i.e.,
|
2002-08-05 04:30:50 +02:00
|
|
|
a table's row type), <literal>d</literal> for a derived type (i.e.,
|
|
|
|
a domain), or <literal>p</literal> for a pseudo-type. See also
|
|
|
|
<structfield>typrelid</structfield>
|
2002-03-20 20:45:13 +01:00
|
|
|
and <structfield>typbasetype</structfield>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typisdefined</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
True if the type is defined, false if this is a placeholder
|
|
|
|
entry for a not-yet-defined type. When
|
|
|
|
<structfield>typisdefined</structfield> is false, nothing
|
|
|
|
except the type name, namespace, and OID can be relied on.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdelim</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2001-11-03 22:42:47 +01:00
|
|
|
<entry>Character that separates two values of this type when parsing
|
|
|
|
array input. Note that the delimiter is associated with the array
|
2002-03-22 20:20:45 +01:00
|
|
|
element data type, not the array data type.</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
If this is a composite type (see
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typtype</structfield>), then this column points to
|
2002-08-28 17:02:55 +02:00
|
|
|
the <structname>pg_class</structname> entry that defines the
|
|
|
|
corresponding table. (For a free-standing composite type, the
|
|
|
|
<structname>pg_class</structname> entry doesn't really represent
|
|
|
|
a table, but it is needed anyway for the type's
|
|
|
|
<structname>pg_attribute</structname> entries to link to.)
|
2003-04-15 15:23:35 +02:00
|
|
|
Zero for base types.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typelem</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
|
|
|
If <structfield>typelem</structfield> is not 0 then it
|
|
|
|
identifies another row in <structname>pg_type</structname>.
|
|
|
|
The current type can then be subscripted like an array yielding
|
2001-11-03 22:42:47 +01:00
|
|
|
values of type <structfield>typelem</structfield>. A
|
|
|
|
<quote>true</quote> array type is variable length
|
|
|
|
(<structfield>typlen</structfield> = -1),
|
|
|
|
but some fixed-length (<structfield>typlen</structfield> > 0) types
|
|
|
|
also have nonzero <structfield>typelem</structfield>, for example
|
|
|
|
<type>name</type> and <type>oidvector</type>.
|
|
|
|
If a fixed-length type has a <structfield>typelem</structfield> then
|
2003-04-15 15:23:35 +02:00
|
|
|
its internal representation must be some number of values of the
|
2002-03-22 20:20:45 +01:00
|
|
|
<structfield>typelem</structfield> data type with no other data.
|
2001-11-03 22:42:47 +01:00
|
|
|
Variable-length array types have a header defined by the array
|
|
|
|
subroutines.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typinput</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Input conversion function (text format)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typoutput</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Output conversion function (text format)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typreceive</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Input conversion function (binary format), or 0 if none</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typsend</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Output conversion function (binary format), or 0 if none</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typalign</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
|
|
|
|
|
|
|
<structfield>typalign</structfield> is the alignment required
|
|
|
|
when storing a value of this type. It applies to storage on
|
|
|
|
disk as well as most representations of the value inside
|
2001-11-21 06:53:41 +01:00
|
|
|
<productname>PostgreSQL</>.
|
2002-09-22 21:42:52 +02:00
|
|
|
When multiple values are stored consecutively, such
|
2000-11-29 21:15:59 +01:00
|
|
|
as in the representation of a complete row on disk, padding is
|
|
|
|
inserted before a datum of this type so that it begins on the
|
|
|
|
specified boundary. The alignment reference is the beginning
|
|
|
|
of the first datum in the sequence.
|
|
|
|
</para><para>
|
|
|
|
Possible values are:
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>c</> = <type>char</type> alignment, i.e., no alignment needed.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>s</> = <type>short</type> alignment (2 bytes on most machines).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>i</> = <type>int</type> alignment (4 bytes on most machines).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>d</> = <type>double</type> alignment (8 bytes on many machines, but by no means all).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para><note>
|
|
|
|
<para>
|
|
|
|
For types used in system tables, it is critical that the size
|
|
|
|
and alignment defined in <structname>pg_type</structname>
|
2003-04-15 15:23:35 +02:00
|
|
|
agree with the way that the compiler will lay out the column in
|
2003-11-01 02:56:29 +01:00
|
|
|
a structure representing a table row.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
</note></entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typstorage</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2002-08-24 17:00:47 +02:00
|
|
|
<structfield>typstorage</structfield> tells for varlena
|
2000-11-29 21:15:59 +01:00
|
|
|
types (those with <structfield>typlen</structfield> = -1) if
|
|
|
|
the type is prepared for toasting and what the default strategy
|
|
|
|
for attributes of this type should be.
|
|
|
|
Possible values are
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>p</>: Value must always be stored plain.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>e</>: Value can be stored in a <quote>secondary</quote>
|
2000-11-29 21:15:59 +01:00
|
|
|
relation (if relation has one, see
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.reltoastrelid</literal>).
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>m</>: Value can be stored compressed inline.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>x</>: Value can be stored compressed inline or stored in <quote>secondary</quote> storage.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2003-04-15 15:23:35 +02:00
|
|
|
Note that <literal>m</> columns can also be moved out to secondary
|
|
|
|
storage, but only as a last resort (<literal>e</> and <literal>x</> columns are
|
2000-11-29 21:15:59 +01:00
|
|
|
moved first).
|
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-19 03:18:25 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typnotnull</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>bool</type></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typnotnull</structfield> represents a not-null
|
|
|
|
constraint on a type. Used for domains only.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-20 20:45:13 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typbasetype</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><para>
|
|
|
|
If this is a derived type (see <structfield>typtype</structfield>),
|
|
|
|
then <structfield>typbasetype</structfield> identifies
|
|
|
|
the type that this one is based on. Zero if not a derived type.
|
|
|
|
</para></entry>
|
|
|
|
</row>
|
2002-03-19 03:18:25 +01:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typtypmod</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Domains use <structfield>typtypmod</structfield> to record the <literal>typmod</>
|
2002-09-24 23:26:44 +02:00
|
|
|
to be applied to their base type (-1 if base type does not use a
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>typmod</>). -1 if this type is not a domain.
|
2002-09-24 23:26:44 +02:00
|
|
|
</para></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typndims</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
|
|
|
<structfield>typndims</structfield> is the number of array dimensions
|
2003-11-01 02:56:29 +01:00
|
|
|
for a domain that is an array (that is, <structfield>typbasetype</> is an array type;
|
|
|
|
the domain's <structfield>typelem</> will match the base type's <structfield>typelem</structfield>).
|
2003-04-15 15:23:35 +02:00
|
|
|
Zero for types other than array domains.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdefaultbin</structfield></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
If <structfield>typdefaultbin</> is not null, it is the <function>nodeToString()</function>
|
|
|
|
representation of a default expression for the type. This is
|
2002-03-20 20:45:13 +01:00
|
|
|
only used for domains.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdefault</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2001-09-06 04:07:42 +02:00
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typdefault</> is null if the type has no associated
|
|
|
|
default value. If <structfield>typdefaultbin</> is not null,
|
2002-03-20 20:45:13 +01:00
|
|
|
<structfield>typdefault</> must contain a human-readable version of the
|
|
|
|
default expression represented by <structfield>typdefaultbin</>. If
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typdefaultbin</> is null and <structfield>typdefault</> is
|
2002-03-20 20:45:13 +01:00
|
|
|
not, then <structfield>typdefault</> is the external representation of
|
|
|
|
the type's default value, which may be fed to the type's input
|
|
|
|
converter to produce a constant.
|
2001-09-06 04:07:42 +02:00
|
|
|
</para></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2003-10-18 00:38:20 +02:00
|
|
|
|
|
|
|
<sect1 id="views-overview">
|
|
|
|
<title>System Views</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In addition to the system catalogs, <productname>PostgreSQL</productname>
|
|
|
|
provides a number of built-in views. The system views provide convenient
|
|
|
|
access to some commonly used queries on the system catalogs. Some of these
|
|
|
|
views provide access to internal server state, as well.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="view-table"> lists the system views described here.
|
|
|
|
More detailed documentation of each view follows below.
|
|
|
|
There are some additional views that provide access to the results of
|
|
|
|
the statistics collector; they are described in <xref
|
|
|
|
linkend="monitoring-stats-views-table">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The information schema (<xref linkend="information-schema">) provides
|
|
|
|
an alternative set of views which overlap the functionality of the system
|
|
|
|
views. Since the information schema is SQL-standard whereas the views
|
|
|
|
described here are <productname>PostgreSQL</productname>-specific,
|
|
|
|
it's usually better to use the information schema if it provides all
|
|
|
|
the information you need.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Except where noted, all the views described here are read-only.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table id="view-table">
|
|
|
|
<title>System Views</title>
|
|
|
|
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>View Name</entry>
|
|
|
|
<entry>Purpose</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-indexes"><structname>pg_indexes</structname></link></entry>
|
|
|
|
<entry>indexes</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-locks"><structname>pg_locks</structname></link></entry>
|
|
|
|
<entry>currently held locks</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-rules"><structname>pg_rules</structname></link></entry>
|
|
|
|
<entry>rules</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-settings"><structname>pg_settings</structname></link></entry>
|
|
|
|
<entry>parameter settings</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-stats"><structname>pg_stats</structname></link></entry>
|
|
|
|
<entry>planner statistics</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-tables"><structname>pg_tables</structname></link></entry>
|
|
|
|
<entry>tables</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-user"><structname>pg_user</structname></link></entry>
|
|
|
|
<entry>database users</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-views"><structname>pg_views</structname></link></entry>
|
|
|
|
<entry>views</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-indexes">
|
|
|
|
<title><structname>pg_indexes</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-indexes">
|
|
|
|
<primary>pg_indexes</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_indexes</structname> provides access to
|
|
|
|
useful information about each index in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_indexes</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>name of schema containing table and index</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of table the index is for</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>indexname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of index</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>indexdef</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>index definition (a reconstructed creation command)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-locks">
|
|
|
|
<title><structname>pg_locks</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-locks">
|
|
|
|
<primary>pg_locks</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_locks</structname> provides access to
|
|
|
|
information about the locks held by open transactions within the
|
|
|
|
database server. See <xref linkend="mvcc"> for more discussion
|
|
|
|
of locking.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_locks</structname> contains one row per active lockable
|
|
|
|
object, requested lock mode, and relevant transaction. Thus, the same
|
|
|
|
lockable object may
|
|
|
|
appear many times, if multiple transactions are holding or waiting
|
|
|
|
for locks on it. However, an object that currently has no locks on it
|
|
|
|
will not appear at all. A lockable object is either a relation (e.g., a
|
|
|
|
table) or a transaction ID.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Note that this view includes only table-level
|
|
|
|
locks, not row-level ones. If a transaction is waiting for a
|
|
|
|
row-level lock, it will appear in the view as waiting for the
|
|
|
|
transaction ID of the current holder of that row lock.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_locks</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>relation</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
OID of the locked relation, or NULL if the lockable object
|
|
|
|
is a transaction ID
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>database</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
OID of the database in which the locked relation exists, or
|
|
|
|
zero if the locked relation is a globally-shared table, or
|
|
|
|
NULL if the lockable object is a transaction ID
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>transaction</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
ID of a transaction, or NULL if the lockable object is a relation
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>pid</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>process ID of a server process holding or awaiting this
|
|
|
|
lock</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>mode</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>name of the lock mode held or desired by this process (see <xref
|
|
|
|
linkend="locking-tables">)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>granted</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>true if lock is held, false if lock is awaited</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structfield>granted</structfield> is true in a row representing a lock
|
|
|
|
held by the indicated session. False indicates that this session is
|
|
|
|
currently waiting to acquire this lock, which implies that some other
|
|
|
|
session is holding a conflicting lock mode on the same lockable object.
|
|
|
|
The waiting session will sleep until the other lock is released (or a
|
|
|
|
deadlock situation is detected). A single session can be waiting to acquire
|
|
|
|
at most one lock at a time.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Every transaction holds an exclusive lock on its transaction ID for its
|
|
|
|
entire duration. If one transaction finds it necessary to wait specifically
|
|
|
|
for another transaction, it does so by attempting to acquire share lock on
|
|
|
|
the other transaction ID. That will succeed only when the other transaction
|
|
|
|
terminates and releases its locks.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When the <structname>pg_locks</structname> view is accessed, the
|
|
|
|
internal lock manager data structures are momentarily locked, and
|
|
|
|
a copy is made for the view to display. This ensures that the
|
|
|
|
view produces a consistent set of results, while not blocking
|
|
|
|
normal lock manager operations longer than necessary. Nonetheless
|
|
|
|
there could be some impact on database performance if this view is
|
|
|
|
read often.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_locks</structname> provides a global view of all locks
|
|
|
|
in the database cluster, not only those relevant to the current database.
|
|
|
|
Although its <structfield>relation</structfield> column can be joined
|
|
|
|
against <structname>pg_class</>.<structfield>oid</> to identify locked
|
|
|
|
relations, this will only work correctly for relations in the current
|
|
|
|
database (those for which the <structfield>database</structfield> column
|
|
|
|
is either the current database's OID or zero).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you have enabled the statistics collector, the
|
|
|
|
<structfield>pid</structfield> column can be joined to the
|
|
|
|
<structfield>procpid</structfield> column of the
|
|
|
|
<structname>pg_stat_activity</structname> view to get more
|
|
|
|
information on the session holding or waiting to hold the lock.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-rules">
|
|
|
|
<title><structname>pg_rules</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-rules">
|
|
|
|
<primary>pg_rules</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_rules</structname> provides access to
|
|
|
|
useful information about query rewrite rules.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_rules</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>name of schema containing table</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of table the rule is for</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rulename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link>.rulename</literal></entry>
|
|
|
|
<entry>name of rule</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>definition</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>rule definition (a reconstructed creation command)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_rules</structname> view excludes the ON SELECT rules of
|
|
|
|
views; those can be seen in <structname>pg_views</structname>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-settings">
|
|
|
|
<title><structname>pg_settings</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-settings">
|
|
|
|
<primary>pg_settings</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_settings</structname> provides access to
|
|
|
|
run-time parameters of the server. It is essentially an alternative
|
|
|
|
interface to the <command>SHOW</> and <command>SET</> commands.
|
|
|
|
It also provides access to some facts about each parameter that are
|
|
|
|
not directly available from <command>SHOW</>, such as minimum and
|
|
|
|
maximum values.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_settings</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>run-time configuration parameter name</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>setting</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>current value of the parameter</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>context</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>context required to set the parameter's value</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>vartype</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>parameter type (<literal>bool</>, <literal>integer</>,
|
|
|
|
<literal>real</>, or <literal>string</>)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>source</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>source of the current parameter value</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>min_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>minimum allowed value of the parameter (NULL for nonnumeric
|
|
|
|
values)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>max_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>maximum allowed value of the parameter (NULL for nonnumeric
|
|
|
|
values)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_settings</structname> view cannot be inserted into or
|
|
|
|
deleted from, but it can be updated. An <command>UPDATE</command> applied
|
|
|
|
to a row of <structname>pg_settings</structname> is equivalent to executing
|
|
|
|
the <xref linkend="SQL-SET" endterm="SQL-SET-title"> command on that named
|
|
|
|
parameter. The change only affects the value used by the current
|
|
|
|
session. If an <command>UPDATE</command> is issued within a transaction
|
|
|
|
that is later aborted, the effects of the <command>UPDATE</command> command
|
|
|
|
disappear when the transaction is rolled back. Once the surrounding
|
|
|
|
transaction is committed, the effects will persist until the end of the
|
|
|
|
session, unless overridden by another <command>UPDATE</command> or
|
|
|
|
<command>SET</command>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-stats">
|
|
|
|
<title><structname>pg_stats</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-stats">
|
|
|
|
<primary>pg_stats</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_stats</structname> provides access to
|
|
|
|
the information stored in the <link
|
|
|
|
linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>
|
|
|
|
catalog. This view allows access only to rows of
|
|
|
|
<structname>pg_statistic</structname> that correspond to tables the
|
|
|
|
user has permission to read, and therefore it is safe to allow public
|
|
|
|
read access to this view.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_stats</structname> is also designed to present the
|
|
|
|
information in a more readable format than the underlying catalog
|
|
|
|
--- at the cost that its schema must be extended whenever new slot types
|
|
|
|
are defined for <structname>pg_statistic</structname>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_stats</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>name of schema containing table</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of table</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>attname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attname</literal></entry>
|
|
|
|
<entry>name of the column described by this row</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>null_frac</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>fraction of column entries that are null</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>avg_width</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>average width in bytes of column's entries</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>n_distinct</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If greater than zero, the estimated number of distinct values
|
|
|
|
in the column. If less than zero, the negative of the number of
|
|
|
|
distinct values divided by the number of rows. (The negated form
|
|
|
|
is used when <command>ANALYZE</> believes that the number of distinct
|
|
|
|
values
|
|
|
|
is likely to increase as the table grows; the positive form is used
|
|
|
|
when the column seems to have a fixed number of possible values.)
|
|
|
|
For example, -1 indicates a unique column in which the number of
|
|
|
|
distinct values is the same as the number of rows.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_vals</structfield></entry>
|
|
|
|
<entry><type>anyarray</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A list of the most common values in the column. (NULL if
|
|
|
|
no values seem to be more common than any others.)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_freqs</structfield></entry>
|
|
|
|
<entry><type>real[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A list of the frequencies of the most common values,
|
|
|
|
i.e., number of occurrences of each divided by total number of rows.
|
|
|
|
(NULL when <structfield>most_common_vals</structfield> is.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>histogram_bounds</structfield></entry>
|
|
|
|
<entry><type>anyarray</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A list of values that divide the column's values into
|
|
|
|
groups of approximately equal population. The values in
|
|
|
|
<structfield>most_common_vals</>, if present, are omitted from this
|
|
|
|
histogram calculation. (This column is NULL if the column data type
|
|
|
|
does not have a <literal><</> operator or if the
|
|
|
|
<structfield>most_common_vals</> list accounts for the entire
|
|
|
|
population.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>correlation</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Statistical correlation between physical row ordering and
|
|
|
|
logical ordering of the column values. This ranges from -1 to +1.
|
|
|
|
When the value is near -1 or +1, an index scan on the column will
|
|
|
|
be estimated to be cheaper than when it is near zero, due to reduction
|
|
|
|
of random access to the disk. (This column is NULL if the column data
|
|
|
|
type does not have a <literal><</> operator.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The maximum number of entries in the <structfield>most_common_vals</>
|
|
|
|
and <structfield>histogram_bounds</> arrays can be set on a
|
|
|
|
column-by-column basis using the <command>ALTER TABLE SET STATISTICS</>
|
|
|
|
command, or globally by setting the
|
|
|
|
<varname>default_statistics_target</varname> runtime parameter.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-tables">
|
|
|
|
<title><structname>pg_tables</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-tables">
|
|
|
|
<primary>pg_tables</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_tables</structname> provides access to
|
|
|
|
useful information about each table in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_tables</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>name of schema containing table</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of table</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tableowner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usename</literal></entry>
|
|
|
|
<entry>name of table's owner</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hasindexes</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasindex</literal></entry>
|
|
|
|
<entry>true if table has (or recently had) any indexes</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hasrules</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasrules</literal></entry>
|
|
|
|
<entry>true if table has rules</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hastriggers</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.reltriggers</literal></entry>
|
|
|
|
<entry>true if table has triggers</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-user">
|
|
|
|
<title><structname>pg_user</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-user">
|
|
|
|
<primary>pg_user</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_user</structname> provides access to
|
|
|
|
information about database users. This is simply a publicly
|
|
|
|
readable view of
|
|
|
|
<link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>
|
|
|
|
that blanks out the password field.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_user</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesysid</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User id (arbitrary number used to reference this user)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usecreatedb</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User may create databases</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesuper</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User is a superuser</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usecatupd</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
User may update system catalogs. (Even a superuser may not do
|
|
|
|
this unless this column is true.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>passwd</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Not the password (always reads as <literal>********</>)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>valuntil</structfield></entry>
|
|
|
|
<entry><type>abstime</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Account expiry time (only used for password authentication)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>useconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Session defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-views">
|
|
|
|
<title><structname>pg_views</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-views">
|
|
|
|
<primary>pg_views</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_views</structname> provides access to
|
|
|
|
useful information about each view in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_views</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols=4>
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>name of schema containing view</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>viewname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>name of view</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>viewowner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usename</literal></entry>
|
|
|
|
<entry>name of view's owner</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>definition</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>view definition (a reconstructed SELECT query)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
</chapter>
|
2001-11-21 06:53:41 +01:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode:sgml
|
|
|
|
sgml-omittag:nil
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-tabs-mode:nil
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"./reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:("/usr/share/sgml/catalog")
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|