Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1efd7330
Commit
1efd7330
authored
Nov 29, 2000
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite system catalog documentation man page in DocBook with more recent
information.
parent
175f5208
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1920 additions
and
458 deletions
+1920
-458
doc/src/sgml/catalogs.sgml
doc/src/sgml/catalogs.sgml
+1912
-445
doc/src/sgml/developer.sgml
doc/src/sgml/developer.sgml
+2
-7
doc/src/sgml/extend.sgml
doc/src/sgml/extend.sgml
+2
-2
doc/src/sgml/sql.sgml
doc/src/sgml/sql.sgml
+4
-4
No files found.
doc/src/sgml/catalogs.sgml
View file @
1efd7330
.\" This is -*-nroff-*-
<!--
.\" XXX standard disclaimer belongs here....
Documentation of the system catalogs, directed toward PostgreSQL developers
.\" $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.7 2000/07/17 03:04:40 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.8 2000/11/29 20:15:58 petere Exp $
.TH "SYSTEM CATALOGS" INTRO 03/13/94 PostgreSQL PostgreSQL
-->
.SH "Section 7 - System Catalogs"
.de LS
<chapter id="catalogs">
.PP
<title>System Catalogs</title>
.if n .ta 5 +13 +13
.if t .ta 0.5i +1.3i +1.3i
<section id="catalogs-overview">
.in 0
<title>Overview</title>
.nf
..
<para>
.de LE
The system catalogs are the place where a relational database
.fi
management system stores schema metadata, such as information about
.in
tables and columns, and internal bookkeeping information.
..
<productname>PostgreSQL</productname>'s system catalogs are regular
.SH "DESCRIPTION"
tables. You can drop and recreate the tables, add columns, insert
In this
and update values, and severely mess up your system that way.
section we list each of the attributes of the system catalogs and
Normally one never has to change the system catalogs by hand, there
define their meanings.
are always SQL commands to do that. (For example, <command>CREATE
.SH "CLASS/TYPE SYSTEM CATALOGS"
DATABASE</command> inserts a row into the
These catalogs form the core of the extensibility system:
<structname>pg_database</structname> catalog -- and actually
.LS
creates the database on disk.) There are some exceptions for
\fBname\fP \fBshared/local\fP \fBdescription\fP
esoteric operations, such as adding index access methods.
pg_aggregate local aggregate functions
</para>
pg_am local access methods
pg_amop local operators usable with specific access methods
<table>
pg_amproc local procedures used with specific access methods
<title>System Catalogs</title>
pg_attribute local class attributes
pg_class local classes
<tgroup cols="2">
pg_index local indices
<thead>
pg_inherits local class inheritance hierarchy
<row>
pg_language local procedure implementation languages
<entry>Catalog Name</entry>
pg_opclass local operator classes
<entry>Purpose</entry>
pg_operator local query language operators
</row>
pg_proc local procedures (functions)
</thead>
pg_type local data types
.LE
<tbody>
.SH "ENTITIES"
<row>
These catalogs deal with identification of entities known throughout
<entry>pg_aggregate</entry>
the site:
<entry>aggregate functions</entry>
.LS
</row>
\fBname\fP \fBshared/local\fP \fBdescription\fP
pg_database shared current databases
<row>
pg_group shared user groups
<entry>pg_am</entry>
pg_shadow shared valid users
<entry>index access methods</entry>
.LE
</row>
.SH "RULE SYSTEM CATALOGS"
.LS
<row>
\fBname\fP \fBshared/local\fP \fBdescription\fP
<entry>pg_amop</entry>
pg_listener local processes waiting on alerters
<entry>access method operators</entry>
pg_prs2plans local instance system procedures
</row>
pg_prs2rule local instance system rules
pg_prs2stub local instance system ``stubs''
<row>
pg_rewrite local rewrite system information
<entry>pg_amproc</entry>
.LE
<entry>access method support procedures</entry>
.SH "LARGE OBJECT CATALOGS"
</row>
.PP
These catalogs are specific to the Inversion file system and large
<row>
objects in general:
<entry>pg_attrdef</entry>
.LS
<entry>column default values</entry>
\fBname\fP \fBshared/local\fP \fBdescription\fP
</row>
pg_lobj local description of a large object
pg_naming local Inversion name space mapping
<row>
pg_platter local jukebox platter inventory
<entry>pg_attribute</entry>
pg_plmap local jukebox platter extent map
<entry>table columns (attributes, fields)</entry>
.LE
</row>
.SH "INTERNAL CATALOGS"
.PP
<row>
These catalogs are internal classes that are not stored as normal
<entry>pg_class</entry>
heaps and cannot be accessed through normal means (attempting to do so
<entry>tables, indexes, sequences (<quote>relations</quote>)</entry>
causes an error).
</row>
.LS
\fBname\fP \fBshared/local\fP \fBdescription\fP
<row>
pg_log shared transaction commit/rollback log
<entry>pg_database</entry>
pg_magic shared magic constant
<entry>databases</entry>
pg_time shared commit/rollback times
</row>
pg_variable shared special variable values
.LE
<row>
.PP
<entry>pg_description</entry>
There are several other classes defined with \*(lqpg_\*(rq names.
<entry>descriptions or comments on database objects</entry>
Aside from those that end in \*(lqind\*(rq (secondary indices), these
</row>
are all obsolete or otherwise deprecated.
.SH "CLASS/TYPE SYSTEM CATALOGS"
<row>
.PP
<entry>pg_group</entry>
The following catalogs relate to the class/type system.
<entry>user groups</entry>
.nf M
</row>
/*
* aggregates
<row>
*
<entry>pg_index</entry>
* see DEFINE AGGREGATE for an explanation of transition functions
<entry>additional index information</entry>
*/
</row>
pg_aggregate
NameData aggname /* aggregate name (e.g., "count") */
<row>
oid aggowner /* usesysid of creator */
<entry>pg_inheritproc</entry>
regproc aggtransfn /* transition function */
<entry>(not used)</entry>
regproc aggfinalfn /* final function */
</row>
oid aggbasetype /* type of data on which aggregate
operates */
<row>
oid aggtranstype /* type of aggregate's transition
<entry>pg_inherits</entry>
(state) data */
<entry>table inheritance hierarchy</entry>
oid aggfinaltype /* type of aggregate's final result */
</row>
text agginitval /* external format of initial state value */
.fi
<row>
.nf M
<entry>pg_ipl</entry>
pg_am
<entry>(not used)</entry>
NameData amname /* access method name */
</row>
oid amowner /* usesysid of creator */
int2 amstrategies /* total NUMBER of strategies by which
<row>
we can traverse/search this AM */
<entry>pg_language</entry>
int2 amsupport /* total NUMBER of support functions
<entry>languages for writing functions</entry>
that this AM uses */
</row>
int2 amorderstrategy /* if this AM has a sort order, the
* strategy number of the sort operator.
<row>
* Zero if AM is not ordered.
<entry>pg_largeobject</entry>
*/
<entry>large objects</entry>
regproc amgettuple /* "next valid tuple" function */
</row>
regproc aminsert /* "insert this tuple" function */
regproc amdelete /* "delete this tuple" function */
<row>
regproc amgetattr /* - deprecated */
<entry>pg_listener</entry>
regproc amsetlock /* - deprecated */
<entry>asynchronous notification</entry>
regproc amsettid /* - deprecated */
</row>
regproc amfreetuple /* - deprecated */
regproc ambeginscan /* "start new scan" function */
<row>
regproc amrescan /* "restart this scan" function */
<entry>pg_opclass</entry>
regproc amendscan /* "end this scan" function */
<entry>index access method operator classes</entry>
regproc ammarkpos /* "mark current scan position"
</row>
function */
regproc amrestrpos /* "restore marked scan position"
<row>
function */
<entry>pg_operator</entry>
regproc amopen /* - deprecated */
<entry>operators</entry>
regproc amclose /* - deprecated */
</row>
regproc ambuild /* "build new index" function */
regproc amcreate /* - deprecated */
<row>
regproc amdestroy /* - deprecated */
<entry>pg_proc</entry>
regproc amcostestimate /* estimate cost of an indexscan */
<entry>functions and procedures</entry>
</row>
.fi
.nf M
<row>
pg_amop
<entry>pg_relcheck</entry>
oid amopid /* access method with which this
<entry>check constraints</entry>
operator be used */
</row>
oid amopclaid /* operator class with which this
operator can be used */
<row>
oid amopopr /* the operator */
<entry>pg_rewrite</entry>
int2 amopstrategy /* traversal/search strategy number
<entry>query rewriter rules</entry>
to which this operator applies */
</row>
.fi
.nf M
<row>
pg_amproc
<entry>pg_shadow</entry>
oid amid /* access method with which this
<entry>database users</entry>
procedure is associated */
</row>
oid amopclaid /* operator class with which this
operator can be used */
<row>
oid amproc /* the procedure */
<entry>pg_statistic</entry>
int2 amprocnum /* support function number to which
<entry>optimizer statistics</entry>
this operator applies */
</row>
.fi
.nf M
<row>
pg_class
<entry>pg_trigger</entry>
NameData relname /* class name */
<entry>triggers</entry>
oid relowner /* usesysid of owner */
</row>
oid relam /* access method */
int4 relpages /* # of 8KB pages */
<row>
int4 reltuples /* # of instances */
<entry>pg_type</entry>
abstime relexpires /* time after which instances are
<entry>data types</entry>
deleted from non-archival storage */
</row>
reltime relpreserved /* timespan after which instances are
</tbody>
deleted from non-archival storage */
</tgroup>
bool relhasindex /* does the class have a secondary
</table>
index? */
bool relisshared /* is the class shared or local? */
<para>
char relkind /* type of relation:
More detailed documentation of most catalogs follow below. The
i=index
catalogs that relate to index access methods are explained in the
r=relation (heap)
<citetitle>Programmer's Guide</citetitle>. Some catalogs don't
s=special
have any documentation, yet.
u=uncatalogued (temporary) */
</para>
char relarch /* archive mode:
h=heavy
</section>
l=light
n=none */
int2 relnatts /* current # of non-system
<section id="catalog-pg-aggregate">
attributes */
<title>pg_aggregate</title>
int2 relsmgr /* storage manager:
0=magnetic disk
<para>
1=sony WORM jukebox
<structname>pg_aggregate</structname> stores information about
2=main memory */
aggregate functions. An aggregate function is a function that
int2vector relkey /* - unused */
operates on a set of values (typically one column from each the row
oidvector relkeyop /* - unused */
that matches a query condition) and returns a single value computed
bool relhassubclass /* does the class have a subclass?
from all these values. Typical aggregate functions are
*/
<function>sum</function>, <function>count</function>, and
aclitem relacl[1] /* access control lists */
<function>max</function>.
.fi
</para>
.nf M
pg_attribute
<table>
oid attrelid /* class containing this attribute */
<title>pg_aggregate Columns</title>
NameData attname /* attribute name */
oid atttypid /* attribute type */
<tgroup cols=4>
oid attdefrel /* - deprecated */
<thead>
int4 attnvals /* - deprecated */
<row>
oid atttyparg /* - deprecated */
<entry>Name</entry>
int2 attlen /* attribute length, in bytes
<entry>Type</entry>
-1=variable */
<entry>References</entry>
int2 attnum /* attribute number
<entry>Description</entry>
>0=user attribute
</row>
<0=system attribute */
</thead>
int2 attbound /* - deprecated */
<tbody>
bool attbyval /* type passed by value? */
<row>
bool attcanindex /* - deprecated */
<entry>aggname</entry>
oid attproc /* - deprecated */
<entry><type>name</type></entry>
int4 attnelems /* # of array dimensions */
<entry></entry>
int4 attcacheoff /* cached offset into tuple */
<entry>Name of the aggregate function</entry>
bool attisset /* is attribute set-valued? */
</row>
.fi
<row>
.nf M
<entry>aggowner</entry>
pg_inherits
<entry><type>int4</type></entry>
oid inhrel /* child class */
<entry>pg_shadow.usesysid</entry>
oid inhparent /* parent class */
<entry>Owner (creator) of the aggregate function</entry>
int4 inhseqno /* - deprecated */
</row>
.fi
<row>
.nf M
<entry>aggtransfn</entry>
oid indexrelid /* oid of secondary index class */
<entry><type>regproc</type> (function)</entry>
oid indrelid /* oid of indexed heap class */
<entry></entry>
oid indproc /* function to compute index key from
<entry>Transition function</entry>
attribute(s) in heap
</row>
0=not a functional index */
<row>
int2vector indkey /* attribute numbers of key
<entry>aggfinalfn</entry>
attribute(s) */
<entry><type>regproc</type> (function)</entry>
oidvector indclass /* opclass of each key */
<entry></entry>
bool indisclustered /* is the index clustered?
<entry>Final function</entry>
- unused */
</row>
bool indisarchived /* is the index archival?
<row>
- unused */
<entry>aggbasetype</entry>
text indpred /* query plan for partial index
<entry><type>oid</type></entry>
predicate */
<entry>pg_type.oid</entry>
.fi
<entry>The type on which this function operates when invoked from SQL</entry>
.nf M
</row>
pg_type
<row>
NameData typname /* type name */
<entry>aggtranstype</entry>
oid typowner /* usesysid of owner */
<entry><type>oid</type></entry>
int2 typlen /* length in internal form
<entry>pg_type.oid</entry>
-1=variable-length */
<entry>The type of the aggregate function's internal transition (state) data</entry>
int2 typprtlen /* length in external form */
</row>
bool typbyval /* type passed by value? */
<row>
char typtype /* kind of type:
<entry>aggfinaltype</entry>
c=catalog (composite)
<entry><type>oid</type></entry>
b=base */
<entry>pg_type.oid</entry>
bool typisdefined /* defined or still a shell? */
<entry>The type of the result</entry>
char typdelim /* delimiter for array external form */
</row>
oid typrelid /* class (if composite) */
<row>
oid typelem /* type of each array element */
<entry>agginitval</entry>
regproc typinput /* external-internal conversion
<entry><type>text</type></entry>
function */
<entry></entry>
regproc typoutput /* internal-external conversion
<entry>
function */
The initial value of the transition state. This is a text
regproc typreceive /* client-server conversion function */
field which will be cast to the type of aggtranstype.
regproc typsend /* server-client conversion function */
</entry>
text typdefault /* default value */
</row>
.fi
</tbody>
.nf M
</tgroup>
pg_operator
</table>
NameData oprname /* operator name */
oid oprowner /* usesysid of owner */
<para>
int2 oprprec /* - deprecated */
New aggregate functions are registered with the <command>CREATE
char oprkind /* kind of operator:
AGGREGATE</command> command. See the <citetitle>Programmer's
b=binary
Guide</citetitle> for more information about writing aggregate
l=left unary
functions and the meaning of the transition functions, etc.
r=right unary */
</para>
bool oprisleft /* is operator left/right associative? */
bool oprcanhash /* is operator usable for hashjoin? */
<para>
oid oprleft /* left operand type */
An aggregate function is identified through name
oid oprright /* right operand type */
<emphasis>and</emphasis> argument type. Hence aggname and aggname
oid oprresult /* result type */
are the composite primary key.
oid oprcom /* commutator operator */
</para>
oid oprnegate /* negator operator */
oid oprlsortop /* sort operator for left operand */
</section>
oid oprrsortop /* sort operator for right operand */
regproc oprcode /* function implementing this operator */
regproc oprrest /* function to calculate operator
<section id="catalog-pg-attrdef">
restriction selectivity */
<title>pg_attrdef</title>
regproc oprjoin /* function to calculate operator
join selectivity */
<para>
.fi
This catalog stores column default values. The main information
.nf M
about columns is stored in <structname>pg_attribute</structname>
pg_opclass
(see below). Only columns that explicitly specify a default value
NameData opcname /* operator class name */
(when the table is created or the column is added) will have an
.fi
entry here.
.nf M
</para>
pg_proc
NameData proname /* function name */
<table>
oid proowner /* usesysid of owner */
<title>pg_attrdef Columns</title>
oid prolang /* function implementation language */
bool proisinh /* - deprecated */
<tgroup cols=4>
bool proistrusted /* run in server or untrusted function
<thead>
process? */
<row>
bool proiscachable /* can the function return values be
<entry>Name</entry>
cached? */
<entry>Type</entry>
int2 pronargs /* # of arguments */
<entry>References</entry>
bool proretset /* does the function return a set?
<entry>Description</entry>
- unused */
</row>
oid prorettype /* return type */
</thead>
oidvector proargtypes /* argument types */
int4 probyte_pct /* % of argument size (in bytes) that
<tbody>
needs to be examined in order to
<row>
compute the function */
<entry>adrelid</entry>
int4 properbyte_cpu /* sensitivity of the function's
<entry><type>oid</type></entry>
running time to the size of its
<entry>pg_class.oid</entry>
inputs */
<entry>The table this column belongs to</entry>
int4 propercall_cpu /* overhead of the function's
</row>
invocation (regardless of input
size) */
<row>
int4 prooutin_ratio /* size of the function's output as a
<entry>adnum</entry>
percentage of the size of the input */
<entry><type>int2</type></entry>
text prosrc /* function definition:
<entry></entry>
INTERNAL function: actual C name of function
<entry>
C function: currently, this field is unused
The number of the column; see
SQL function: text of query(s)
<structname>pg_attribute</structname>.<structfield>pg_attnum</structfield>
PL function: text in procedural language */
</entry>
bytea probin /* path to object file (C functions only) */
</row>
.fi
.nf M
<row>
pg_language
<entry>adbin</entry>
NameData lanname /* language name */
<entry><type>text</type></entry>
text lancompiler /* - deprecated */
<entry></entry>
.fi
<entry>An internal representation of the column default value</entry>
.SH "ENTITIES"
</row>
.nf M
pg_database
<row>
NameData datname /* database name */
<entry>adsrc</entry>
oid datdba /* usesysid of database administrator */
<entry><type>text</type></entry>
text datpath /* directory of database under
<entry></entry>
$PGDATA */
<entry>A human-readable representation of the default value</entry>
.fi
</row>
.nf M
</tbody>
pg_group
</tgroup>
NameData groname /* group name */
</table>
int2 grosysid /* group's UNIX group id */
int2 grolist[1] /* list of usesysids of group members */
</section>
.fi
.nf M
pg_shadow
<section id="catalog-pg-attribute">
NameData usename /* user's name */
<title>pg_attribute</title>
int2 usesysid /* user's UNIX user id */
bool usecreatedb /* can user create databases? */
<para>
bool usetrace /* can user set trace flags? */
<structname>pg_attribute</structname> stores information about
bool usesuper /* can user be POSTGRES superuser? */
table columns. There will be exactly one
bool usecatupd /* can user update catalogs? */
<structname>pg_attribute</structname> row for every column in every
.fi
table in the database. (There will also be attribute entries for
.SH "RULE SYSTEM CATALOGS"
indexes and other objects. See <structname>pg_class</structname>.)
.nf M
</para>
pg_listener
NameData relname /* class for which asynchronous
<para>
notification is desired */
The term attribute is equivalent to column and is used for
int4 listenerpid /* process id of server corresponding
historical reasons.
to a frontend program waiting for
</para>
asynchronous notification */
int4 notification /* whether an event notification for
<table>
this process id still pending */
<title>pg_attribute Columns</title>
.fi
<tgroup cols=4>
.nf M
<thead>
pg_prs2rule
<row>
NameData prs2name /* rule name */
<entry>Name</entry>
char prs2eventtype /* rule event type:
<entry>Type</entry>
R=retrieve
<entry>References</entry>
U=update (replace)
<entry>Description</entry>
A=append
</row>
D=delete */
</thead>
oid prs2eventrel /* class to which event applies */
int2 prs2eventattr /* attribute to which event applies */
<tbody>
float8 necessary /* - deprecated */
<row>
float8 sufficient /* - deprecated */
<entry>attrelid</entry>
text prs2text /* text of original rule definition */
<entry><type>oid</type></entry>
.fi
<entry>pg_class.oid</entry>
.nf M
<entry>The table this column belongs to</entry>
pg_prs2plans
</row>
oid prs2ruleid /* prs2rule instance for which this
plan is used */
<row>
int2 prs2planno /* plan number (one rule may invoke
<entry>attname</entry>
multiple plans) */
<entry><type>name</type></entry>
text prs2code /* external representation of the plan */
<entry></entry>
.fi
<entry>Column name</entry>
.nf M
</row>
pg_prs2stub
oid prs2relid /* class to which this rule applies */
<row>
bool prs2islast /* is this the last stub fragment? */
<entry>atttypid</entry>
int4 prs2no /* stub fragment number */
<entry><type>oid</type></entry>
stub prs2stub /* stub fragment */
<entry>pg_type.oid</entry>
.fi
<entry>The data type of this column</entry>
.nf M
</row>
pg_rewrite
NameData rulename /* rule name */
<row>
char ev_type /* event type:
<entry>attdispersion</entry>
RETRIEVE, REPLACE, APPEND, DELETE
<entry><type>float4</type></entry>
codes are parser-dependent (!?) */
<entry></entry>
oid ev_class /* class to which this rule applies */
<entry>
int2 ev_attr /* attribute to which this rule applies */
<structfield>attdispersion</structfield> is the dispersion
bool is_instead /* is this an "instead" rule? */
statistic of the column (0.0 to 1.0), or zero if the statistic
text ev_qual /* qualification with which to modify
has not been calculated, or -1.0 if <command>VACUUM</command>
(rewrite) the plan that triggered this
found that the column contains no duplicate entries (in which
rule */
case the dispersion should be taken as
text action /* parse tree of action */
1.0/<symbol>numberOfRows</symbol> for the current table size).
.fi
The -1.0 hack is useful because the number of rows may be
.SH "LARGE OBJECT CATALOGS"
updated more often than
.nf M
<structfield>attdispersion</structfield> is. We assume that the
pg_lobj
column will retain its no-duplicate-entry property.
oid ourid /* 'ourid' from pg_naming that
</entry>
identifies this object in the
</row>
Inversion file system namespace */
int4 objtype /* storage type code:
<row>
0=Inversion
<entry>attlen</entry>
1=Unix
<entry><type>int2</type></entry>
2=External
<entry></entry>
3=Jaquith */
<entry>
bytea object_descripto/* opaque object-handle structure */
This is a copy of the
.fi
<structname>pg_type</structname>.<structfield>typlen</structfield>
.nf M
for this column's type.
pg_naming
</entry>
NameData filename /* filename component */
</row>
oid ourid /* random oid used to identify this
instance in other instances (can't
<row>
use the actual oid for obscure
<entry>attnum</entry>
reasons */
<entry><type>int2</type></entry>
oid parentid /* pg_naming instance of parent
<entry></entry>
Inversion file system directory */
<entry>
.fi
The number of the column. Ordinary columns are numbered from 1
.nf M
up. System columns, such as <structfield>oid</structfield>,
pg_platter
have (arbitrary) negative numbers.
NameData plname /* platter name */
</entry>
int4 plstart /* the highest OCCUPIED extent */
</row>
.fi
.nf M
<row>
pg_plmap
<entry>attnelems</entry>
oid plid /* platter (in pg_platter) on which
<entry><type>int4</type></entry>
this extent (of blocks) resides */
<entry></entry>
oid pldbid /* database of the class to which this
<entry>Number of dimensions, if the column is an array</entry>
extent (of blocks) belongs */
</row>
oid plrelid /* class to which this extend (of
blocks) belongs */
<row>
int4 plblkno /* starting block number within the
<entry>attcacheoff</entry>
class */
<entry><type>int4</type></entry>
int4 ploffset /* offset within the platter at which
<entry></entry>
this extent begins */
<entry>
int4 plextentsz /* length of this extent */
Always -1 in storage, but when loaded into a tuple descriptor
.fi
in memory this may be updated cache the offset of the attribute
within the tuple.
</entry>
</row>
<row>
<entry>atttypmod</entry>
<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
type-specific input and output functions as the third
argument. The value will generally be -1 for types that do not
need typmod.
</entry>
</row>
<row>
<entry>attbyval</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
A copy of
<structname>pg_type</structname>.<structfield>typbyval</structfield>
of this column's type
</entry>
</row>
<row>
<entry>attstorage</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>
A copy of
<structname>pg_type</structname>.<structfield>typstorage</structfield>
of this column's type
</entry>
</row>
<row>
<entry>attisset</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
If true, this attribute is a set. In that case, what is really
stored in the attribute is the OID of a tuple in the
<structname>pg_proc</structname> catalog. The
<structname>pg_proc</structname> tuple contains the query
string which defines this set - i.e., the query to run to get
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>
<entry>attalign</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>
A copy of
<structname>pg_type</structname>.<structfield>typalign</structfield>
of this column's type
</entry>
</row>
<row>
<entry>attnotnull</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
This represents a NOT NULL constraint. It is possible to
change this field to enable or disable the constraint.
</entry>
</row>
<row>
<entry>atthasdef</entry>
<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>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-class">
<title>pg_class</title>
<para>
<structname>pg_class</structname> catalogues tables and mostly
everything else that has columns or is otherwise similar to a
table. This includes indexes (but see
<structname>pg_index</structname>), sequences, views, and some
kinds of special relation kinds. Below, when we mean all of these
kinds of objects we speak of <quote>relations</quote>. Not all
fields are meaningful for all relation types.
</para>
<table>
<title>pg_class Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>relname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Name of the table, index, view, etc.</entry>
</row>
<row>
<entry>reltype</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<entry>
The data type that corresponds to this table (not functional,
only set for system tables)
</entry>
</row>
<row>
<entry>relowner</entry>
<entry><type>int4</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>Owner of the relation</entry>
</row>
<row>
<entry>relam</entry>
<entry><type>oid</type></entry>
<entry>pg_am.oid</entry>
<entry>If this is an index, the access method used (btree, hash, etc.)</entry>
</row>
<row>
<entry>relfilenode</entry>
<entry><type>oid</type></entry>
<entry></entry>
<entry>Name of the on-disk file of this relation</entry>
</row>
<row>
<entry>relpages</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>
Size of the on-disk representation of this table in pages (size
<symbol>BLCKSZ</symbol>). This is only an approximate value
which is calculated during vacuum.
</entry>
</row>
<row>
<entry>reltuples</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>
Number of tuples in the table. This is only an estimate used
by the planner, updated by <command>VACUUM</command>.
</entry>
</row>
<row>
<entry>reltoastrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>
Oid of the TOAST table associated with this table, 0 if none.
The TOAST table stores large attributes <quote>out of
line</quote> in a secondary table.
</entry>
</row>
<row>
<entry>reltoastidxid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>Oid of the index on the TOAST table for this table, 0 if none</entry>
</row>
<row>
<entry>relhasindex</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>True if this is a table and it has at least one index</entry>
</row>
<row>
<entry>relisshared</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>XXX (This is not what it seems to be.)</entry>
</row>
<row>
<entry>relkind</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>
'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
's' = special, 't' = secondary TOAST table
</entry>
</row>
<row>
<entry>relnatts</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>
Number of columns in the relation, besides system columns.
There must be this many corresponding entries in
<structname>pg_attribute</structname>. See also
<structname>pg_attribute</structname>.<structfield>attnum</structfield>.
</entry>
</row>
<row>
<entry>relchecks</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>
Number of check constraints on the table; see
<structname>pg_relcheck</structname> catalog
</entry>
</row>
<row>
<entry>reltriggers</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>
Number of triggers on the table; see
<structname>pg_trigger</structname> catalog
</entry>
</row>
<row>
<entry>relukeys</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>unused (<emphasis>Not</emphasis> the number of unique keys or something.)</entry>
</row>
<row>
<entry>relfkeys</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>Number foreign keys on the table</entry>
</row>
<row>
<entry>relhaspkey</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
unused (No, this does not say whether the table has a primary
key. It's really unused.)
</entry>
</row>
<row>
<entry>relhasrules</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>Table has rules</entry>
</row>
<row>
<entry>relhassubclass</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>At least one table inherits this one</entry>
</row>
<row>
<entry>relacl</entry>
<entry><type>aclitem[]</type></entry>
<entry></entry>
<entry>
Access permissions. See the descriptions of
<command>GRANT</command> and <command>REVOKE</command> for
details.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-database">
<title>pg_database</title>
<para>
The <structname>pg_database</structname> catalog stores information
about the available databases. The
<structname>pg_database</structname> table is shared between all
databases of a cluster. Databases are created with the
<command>CREATE DATABASE</command>. Consult the
<citetitle>Administrator's Guide</citetitle> for details about the
meaning of some of the parameters.
</para>
<table>
<title>pg_database Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>datname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Database name</entry>
</row>
<row>
<entry>datdba</entry>
<entry><type>int4</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>Owner of the database, initially who created it</entry>
</row>
<row>
<entry>encoding</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>Character/multibyte encoding for this database</entry>
</row>
<row>
<entry>datistemplate</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
If true then this database can be used in the
<quote>TEMPLATE</quote> clause of <command>CREATE
DATABASE</command> to create the new database as a clone of
this one.
</entry>
</row>
<row>
<entry>datallowconn</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
If false then no one can connect to this database. This is
used to protect the template0 database from being altered.
</entry>
</row>
<row>
<entry>datlastsysoid</entry>
<entry><type>oid</type></entry>
<entry></entry>
<entry>
Last oid in existence after the database was created; useful
particularly to <application>pg_dump</application>
</entry>
</row>
<row>
<entry>datpath</entry>
<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>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-description">
<title>pg_description</title>
<para>
The pg_description table can store an optional description or
comment for each database object. Descriptions can be manipulated
with the <command>COMMENT</command> command. Client applications
can view the descriptions by joining with this table. Many builtin
system objects have comments associated with them that are shown by
<application>psql</application>'s <literal>\d</literal> commands.
</para>
<table>
<title>pg_description Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>objoid</entry>
<entry><type>oid</type></entry>
<entry>any oid attribute</entry>
<entry>The oid of the object this description pertains to</entry>
</row>
<row>
<entry>description</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>Arbitrary text that serves as the description of this object.</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-group">
<title>pg_group</title>
<para>
This catalog defines groups and stores what users belong to what
groups. Groups are created with the <command>CREATE
GROUP</command> command. Consult the <citetitle>Administrator's
Guide</citetitle> for information about user permission management.
</para>
<table>
<title>pg_group Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>groname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Name of the group</entry>
</row>
<row>
<entry>grosysid</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>An arbitrary number to identify this group</entry>
</row>
<row>
<entry>grolist</entry>
<entry><type>int4[]</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>An array containing the ids of the users in this group</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-index">
<title>pg_index</title>
<para>
<structname>pg_index</structname> contains part of the information
about indexes. The rest is mostly in
<structname>pg_class</structname>.
</para>
<table>
<title>pg_index Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>indexrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>The oid of the pg_class entry for this index</entry>
</row>
<row>
<entry>indrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>The oid of the pg_class entry for the table this index is for</entry>
</row>
<row>
<entry>indproc</entry>
<entry><type>oid</type></entry>
<entry>pg_proc.oid</entry>
<entry>The registered procedure if this is a functional index</entry>
</row>
<row>
<entry>indkey</entry>
<entry><type>int2vector</type></entry>
<entry>pg_attribute.attnum</entry>
<entry>
This is an vector (array) of up to
<symbol>INDEX_MAX_KEYS</symbol> values that indicate which
table columns this index pertains to. For example a value of
<literal>1 3</literal> would mean that the first and the third
column make up the index key.
</entry>
</row>
<row>
<entry>indclass</entry>
<entry><type>oidvector</type></entry>
<entry>pg_opclass.oid</entry>
<entry>
For each column in the index key this contains a reference to
the <quote>operator class</quote> to use. See
<structname>pg_opclass</structname> for details.
</entry>
</row>
<row>
<entry>indisclustered</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>indislossy</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>???</entry>
</row>
<row>
<entry>indisunique</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>If true, this is a unique index.</entry>
</row>
<row>
<entry>indisprimary</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>If true, this index is a unique index that represents the primary key of the table.</entry>
</row>
<row>
<entry>indreference</entry>
<entry><type>oid</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>indpred</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>Query plan for partial index predicate (not functional)</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-inherits">
<title>pg_inherits</title>
<para>
This catalog records information about table inheritance hierarchies.
</para>
<table>
<title>pg_inherits Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>inhrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>
This is the reference to the subtable, that is, it records the
fact that the identified table is inherited from some other
table.
</entry>
</row>
<row>
<entry>inhparent</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>
This is the reference to the parent table, from which the table
referenced by <structfield>inhrelid</structfield> inherited
from.
</entry>
</row>
<row>
<entry>inhseqno</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>
If there is more than one subtable/parent pair (multiple
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>
</section>
<section id="catalog-pg-language">
<title>pg_language</title>
<para>
<structname>pg_language</structname> registers call interfaces or
languages in which you can write functions or stored procedures.
See under <command>CREATE LANGUAGE</command> and in the
<citetitle>Programmer's Guide</citetitle> for more information
about language handlers.
</para>
<table>
<title>pg_language Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>lanname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Name of the language (to be specified when creating a function)</entry>
</row>
<row>
<entry>lanispl</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
This is false for internal languages (such as SQL) and true for
dynamically loaded language handler modules. It essentially
means that, if it is true, the language may be dropped.
</entry>
</row>
<row>
<entry>lanpltrusted</entry>
<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
this field is meaningless.
</entry>
</row>
<row>
<entry>lanplcallfoid</entry>
<entry><type>oid</type></entry>
<entry>pg_proc.oid</entry>
<entry>
For non-internal languages this references the language
handler, which is a special function that is responsible for
executing all functions that are written in the particular
language.
</entry>
</row>
<row>
<entry>lancompiler</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>not useful</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-operator">
<title>pg_operator</title>
<para>
See <command>CREATE OPERATOR</command> and the
<citetitle>Programmer's Guide</citetitle> for details on these
operator parameters.
</para>
<table>
<title>pg_operator Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>oprname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Name of the operator</entry>
</row>
<row>
<entry>oprowner</entry>
<entry><type>int4</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>Owner (creator) of the operator</entry>
</row>
<row>
<entry>oprprec</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>oprkind</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>
'b' = infix (<quote>both</quote>), 'l' = prefix
(<quote>left</quote>), 'r' = postfix (<quote>right</quote>)
</entry>
</row>
<row>
<entry>oprisleft</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>oprcanhash</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>This operator supports hash joins.</entry>
</row>
<row>
<entry>oprleft</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<entry>Type of the left operand</entry>
</row>
<row>
<entry>oprright</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<entry>Type of the right operand</entry>
</row>
<row>
<entry>oprresult</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<entry>Type of the result</entry>
</row>
<row>
<entry>oprcom</entry>
<entry><type>oid</type></entry>
<entry>pg_operator.oid</entry>
<entry>Commutator of this operator, if any</entry>
</row>
<row>
<entry>oprnegate</entry>
<entry><type>oid</type></entry>
<entry>pg_operator.oid</entry>
<entry>Inverse of this operator, if any</entry>
</row>
<row>
<entry>oprlsortop</entry>
<entry><type>oid</type></entry>
<entry>pg_operator.oid</entry>
<entry>
If this operator supports merge joins, the operator that sorts
the type of the left-hand operand
</entry>
</row>
<row>
<entry>oprrsortop</entry>
<entry><type>oid</type></entry>
<entry>pg_operator.oid</entry>
<entry>
If this operator supports merge joins, the operator that sorts
the type of the left-hand operand
</entry>
</row>
<row>
<entry>oprcode</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>Function that implements this operator</entry>
</row>
<row>
<entry>oprrest</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>Restriction selectivity estimation function for this operator</entry>
</row>
<row>
<entry>oprjoin</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>Join selectivity estimation function for this operator</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-proc">
<title>pg_proc</title>
<para>
This catalog stores information about functions (or procedures).
The description of <command>CREATE FUNCTION</command> and the
<citetitle>Programmer's Guide</citetitle> contain more information
about the meaning of some fields.
</para>
<table>
<title>pg_proc Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>proname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Name of the function</entry>
</row>
<row>
<entry>proowner</entry>
<entry><type>int4</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>Owner (creator) of the function</entry>
</row>
<row>
<entry>prolang</entry>
<entry><type>oid</type></entry>
<entry>pg_language.oid</entry>
<entry>Implementation language or call interface of this function</entry>
</row>
<row>
<entry>proisinh</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>proistrusted</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>not functional</entry>
</row>
<row>
<entry>proiscachable</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>Function returns same result for same input values</entry>
</row>
<row>
<entry>proisstrict</entry>
<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>
<row>
<entry>pronargs</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>Number of arguments</entry>
</row>
<row>
<entry>proretset</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>Function returns a set (probably not functional)</entry>
</row>
<row>
<entry>prorettype</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<entry>Data type of the return value (0 if the function does not return a value)</entry>
</row>
<row>
<entry>proargtypes</entry>
<entry><type>oidvector</type></entry>
<entry>pg_type.oid</entry>
<entry>A vector with the data types of the function arguments</entry>
</row>
<row>
<entry>probyte_pct</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>dead code</entry>
</row>
<row>
<entry>properbyte_pct</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>dead code</entry>
</row>
<row>
<entry>propercall_pct</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>dead code</entry>
</row>
<row>
<entry>prooutin_ratio</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>dead code</entry>
</row>
<row>
<entry>prosrc</entry>
<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
else, depending the implementation language/call convention.
</entry>
</row>
<row>
<entry>probin</entry>
<entry><type>bytea</type></entry>
<entry></entry>
<entry>?</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-relcheck">
<title>pg_relcheck</title>
<para>
This system catalog stores CHECK constraints on tables. (Column
constraints are not treated specially. Every column constraint is
equivalent to some table constraint.) See under <command>CREATE
TABLE</command> for more information.
</para>
<table>
<title>pg_relcheck Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>rcrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>The table this check constraint is on</entry>
</row>
<row>
<entry>rcname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Constraint name</entry>
</row>
<row>
<entry>rcbin</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>An internal representation of the constraint expression</entry>
</row>
<row>
<entry>rcsrc</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>A human-readable representation of the consraint expression</entry>
</row>
</tbody>
</tgroup>
</table>
<note>
<para>
<structname>pg_class</structname>.<structfield>relchecks</structfield>
needs to match up with the entries in this table.
</para>
</note>
</section>
<section id="catalog-pg-shadow">
<title>pg_shadow</title>
<para>
<structname>pg_shadow</structname> contains information about
database users. The name stems from the fact that this table
should not be readable by the public since it contains passwords.
<structname>pg_user</structname> is a view on
<structname>pg_shadow</structname> that blanks out the password field.
</para>
<para>
The <citetitle>Administrator's Guide</citetitle> contains detailed
information about user and permission management.
</para>
<table>
<title>pg_shadow Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>usename</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>User name</entry>
</row>
<row>
<entry>usesysid</entry>
<entry><type>int4</type></entry>
<entry></entry>
<entry>User id (arbitrary number used to reference this user)</entry>
</row>
<row>
<entry>usecreatedb</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>User may create databases</entry>
</row>
<row>
<entry>usetrace</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>not used</entry>
</row>
<row>
<entry>usesuper</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>User is a superuser</entry>
</row>
<row>
<entry>usecatupd</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
User may update system catalogs. (Even a superuser may not do
this unless this attribute is true.)
</entry>
</row>
<row>
<entry>passwd</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>Password</entry>
</row>
<row>
<entry>valuntil</entry>
<entry><type>abstime</type></entry>
<entry></entry>
<entry>Account expiry time (only used for password authentication)</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="catalog-pg-type">
<title>pg_type</title>
<table>
<title>pg_type Columns</title>
<tgroup cols=4>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>References</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>typname</entry>
<entry><type>name</type></entry>
<entry></entry>
<entry>Data type name</entry>
</row>
<row>
<entry>typowner</entry>
<entry><type>int4</type></entry>
<entry>pg_shadow.usesysid</entry>
<entry>Owner (creator) of the type</entry>
</row>
<row>
<entry>typlen</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>Length of the storage representation of the type, -1 if variable length</entry>
</row>
<row>
<entry>typprtlen</entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>typbyval</entry>
<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.
Only <type>char</type>, <type>short</type>, and
<type>int</type> equivalent items can be passed by value, so if
the type is not 1, 2, or 4 bytes long, Postgres does not have
the option of passing by value and so
<structfield>typbyval</structfield> had better be false.
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>
<entry>typtype</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>
<structfield>typtype</structfield> is <literal>b</literal> for
a basic type and <literal>c</literal> for a catalog type (i.e.,
a table). If <structfield>typtype</structfield> is
<literal>c</literal>, <structfield>typrelid</structfield> is
the OID of the type's entry in
<structname>pg_class</structname>.
</entry>
</row>
<row>
<entry>typisdefined</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>???</entry>
</row>
<row>
<entry>typdelim</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry>Character that separates two values of this type when parsing array input</entry>
</row>
<row>
<entry>typrelid</entry>
<entry><type>oid</type></entry>
<entry>pg_class.oid</entry>
<entry>
If this is a catalog type (see
<structfield>typtype</structfield>), then this field points to
the <structfield>pg_class</structfield> entry that defines the
corresponding table. A table could theoretically be used as a
composite data type, but this is not fully functional.
</entry>
</row>
<row>
<entry>typelem</entry>
<entry><type>oid</type></entry>
<entry>pg_type.oid</entry>
<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
values of type <structfield>typelem</structfield>. A non-zero
<structfield>typelem</structfield> does not guarantee this type
to be a <quote>real</quote> array type; some ordinary
fixed-length types can also be subscripted (e.g.,
<type>oidvector</type>). Variable-length types can
<emphasis>not</emphasis> be turned into pseudo-arrays like
that. Hence, the way to determine whether a type is a
<quote>true</quote> array type is typelem != 0 and typlen < 0.
</entry>
</row>
<row>
<entry>typinput</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>Input function</entry>
</row>
<row>
<entry>typoutput</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>Output function</entry>
</row>
<row>
<entry>typreceive</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>typsend</entry>
<entry><type>regproc</type></entry>
<entry></entry>
<entry>unused</entry>
</row>
<row>
<entry>typalign</entry>
<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
Postgres. When multiple values are stored consecutively, such
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>
<para>'c' = CHAR alignment, ie no alignment needed.</para>
</listitem>
<listitem>
<para>'s' = SHORT alignment (2 bytes on most machines).</para>
</listitem>
<listitem>
<para>'i' = INT alignment (4 bytes on most machines).</para>
</listitem>
<listitem>
<para>'d' = DOUBLE alignment (8 bytes on many machines, but by no means all).</para>
</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>
agree with the way that the compiler will lay out the field in
a struct representing a table row.
</para>
</note></entry>
</row>
<row>
<entry>typstorage</entry>
<entry><type>char</type></entry>
<entry></entry>
<entry><para>
<structfield>typstorage</structfield> tells for variable-length
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>
<para>'p': Value must always be stored plain.</para>
</listitem>
<listitem>
<para>
'e': Value can be stored in a <quote>secondary</quote>
relation (if relation has one, see
<structname>pg_class</structname>.<structfield>reltoastrelid</structfield>).
</para>
</listitem>
<listitem>
<para>'m': Value can be stored compressed inline.</para>
</listitem>
<listitem>
<para>'x': Value can be stored compressed inline or in <quote>secondary</quote>.</para>
</listitem>
</itemizedlist>
Note that 'm' fields can also be moved out to secondary
storage, but only as a last resort ('e' and 'x' fields are
moved first).
</para></entry>
</row>
<row>
<entry>typdefault</entry>
<entry><type>text</type></entry>
<entry></entry>
<entry>???</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</chapter>
doc/src/sgml/developer.sgml
View file @
1efd7330
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/developer.sgml,v 1.
2 2000/11/24 17:44:21
petere Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/developer.sgml,v 1.
3 2000/11/29 20:15:59
petere Exp $ -->
<!-- PostgreSQL Developer's Guide -->
<!-- PostgreSQL Developer's Guide -->
<book id="developer">
<book id="developer">
...
@@ -17,17 +17,12 @@
...
@@ -17,17 +17,12 @@
&sources;
&sources;
&arch-dev;
&arch-dev;
&geqo;
<!--
This listing of Postgres catalogs is currently just a copy of the old
man page. It is not up to date and has not been marked up for DocBook.
- thomas 2000-04-20
&catalogs;
&catalogs;
-->
&protocol;
&protocol;
&compiler;
&compiler;
&bki;
&bki;
&page;
&page;
&geqo;
<![%single-book;[
<![%single-book;[
&biblio;
&biblio;
]]>
]]>
...
...
doc/src/sgml/extend.sgml
View file @
1efd7330
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.
6 2000/09/29 20:21:33
petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.
7 2000/11/29 20:15:59
petere Exp $
-->
-->
<chapter id="extend">
<chapter id="extend">
...
@@ -107,7 +107,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.6 2000/09/29 20:21:33 peter
...
@@ -107,7 +107,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.6 2000/09/29 20:21:33 peter
</para>
</para>
</sect1>
</sect1>
<sect1 id="system-catalogs">
<sect1 id="
pg-
system-catalogs">
<title>About the <productname>Postgres</productname> System Catalogs</title>
<title>About the <productname>Postgres</productname> System Catalogs</title>
<para>
<para>
...
...
doc/src/sgml/sql.sgml
View file @
1efd7330
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.1
2 2000/09/29 20:21:34
petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.1
3 2000/11/29 20:15:59
petere Exp $
-->
-->
<chapter id="sql">
<chapter id="sql">
...
@@ -1574,7 +1574,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
...
@@ -1574,7 +1574,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
view (i.e. the rules about how to access physically stored base
view (i.e. the rules about how to access physically stored base
tables in order to materialize the view) somewhere in the system
tables in order to materialize the view) somewhere in the system
catalogs (see
catalogs (see
<xref linkend="
catalogs-title" endterm="
catalogs-title">). For a
<xref linkend="
tutorial-catalogs-title" endterm="tutorial-
catalogs-title">). For a
discussion on different techniques to implement views refer to
discussion on different techniques to implement views refer to
<!--
<!--
section
section
...
@@ -1783,8 +1783,8 @@ DELETE FROM SUPPLIER
...
@@ -1783,8 +1783,8 @@ DELETE FROM SUPPLIER
</sect3>
</sect3>
</sect2>
</sect2>
<sect2 id="catalogs">
<sect2 id="
tutorial-
catalogs">
<title id="catalogs-title">System Catalogs</title>
<title id="
tutorial-
catalogs-title">System Catalogs</title>
<para>
<para>
In every <acronym>SQL</acronym> database system
In every <acronym>SQL</acronym> database system
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment