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