2 Documentation of the system catalogs, directed toward PostgreSQL developers
3 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.63 2002/10/14 04:29:23 momjian Exp $
6 <chapter id="catalogs">
7 <title>System Catalogs</title>
9 <sect1 id="catalogs-overview">
10 <title>Overview</title>
13 The system catalogs are the place where a relational database
14 management system stores schema metadata, such as information about
15 tables and columns, and internal bookkeeping information.
16 <productname>PostgreSQL</productname>'s system catalogs are regular
17 tables. You can drop and recreate the tables, add columns, insert
18 and update values, and severely mess up your system that way.
19 Normally one should not change the system catalogs by hand, there
20 are always SQL commands to do that. (For example, <command>CREATE
21 DATABASE</command> inserts a row into the
22 <structname>pg_database</structname> catalog -- and actually
23 creates the database on disk.) There are some exceptions for
24 especially esoteric operations, such as adding index access methods.
27 Most system catalogs are copied from the template database during
28 database creation, and are thereafter database-specific. A few
29 catalogs are physically shared across all databases in an installation;
30 these are marked in the descriptions of the individual catalogs.
34 <title>System Catalogs</title>
39 <entry>Catalog Name</entry>
40 <entry>Purpose</entry>
46 <entry><link linkend="catalog-pg-aggregate">
47 <database class="table">pg_aggregate</database></link></entry>
48 <entry>aggregate functions</entry>
53 <entry>index access methods</entry>
57 <entry>pg_amop</entry>
58 <entry>access method operators</entry>
62 <entry>pg_amproc</entry>
63 <entry>access method support procedures</entry>
67 <entry><link linkend="catalog-pg-attrdef">
68 <database class="table">pg_attrdef</database></link></entry>
69 <entry>column default values</entry>
73 <entry><link linkend="catalog-pg-attribute">
74 <database class="table">pg_attribute</database></link></entry>
75 <entry>table columns (<quote>attributes</quote>, <quote>fields</quote>)</entry>
79 <entry><link linkend="catalog-pg-cast">
80 <database class="table">pg_cast</database></link></entry>
81 <entry>casts (data type conversions)</entry>
85 <entry><link linkend="catalog-pg-class">
86 <database class="table">pg_class</database></link></entry>
87 <entry>tables, indexes, sequences (<quote>relations</quote>)</entry>
91 <entry><link linkend="catalog-pg-constraint">
92 <database class="table">pg_constraint</database></link></entry>
93 <entry>check constraints, unique / primary key constraints, foreign key constraints</entry>
97 <entry><link linkend="catalog-pg-conversion">
98 <database class="table">pg_conversion</database></link></entry>
99 <entry>encoding conversion information</entry>
103 <entry><link linkend="catalog-pg-database">
104 <database class="table">pg_database</database></link></entry>
105 <entry>databases within this database cluster</entry>
109 <entry><link linkend="catalog-pg-depend">
110 <database class="table">pg_depend</database></link></entry>
111 <entry>dependencies between database objects</entry>
115 <entry><link linkend="catalog-pg-description">
116 <database class="table">pg_description</database></link></entry>
117 <entry>descriptions or comments on database objects</entry>
121 <entry><link linkend="catalog-pg-group">
122 <database class="table">pg_group</database></link></entry>
123 <entry>groups of database users</entry>
127 <entry><link linkend="catalog-pg-index">
128 <database class="table">pg_index</database></link></entry>
129 <entry>additional index information</entry>
133 <entry><link linkend="catalog-pg-inherits">
134 <database class="table">pg_inherits</database></link></entry>
135 <entry>table inheritance hierarchy</entry>
139 <entry><link linkend="catalog-pg-language">
140 <database class="table">pg_language</database></link></entry>
141 <entry>languages for writing functions</entry>
145 <entry><link linkend="catalog-pg-largeobject">
146 <database class="table">pg_largeobject</database></link></entry>
147 <entry>large objects</entry>
151 <entry><link linkend="catalog-pg-listener">
152 <database class="table">pg_listener</database></link></entry>
153 <entry>asynchronous notification</entry>
157 <entry><link linkend="catalog-pg-namespace">
158 <database class="table">pg_namespace</database></link></entry>
159 <entry>namespaces (schemas)</entry>
163 <entry><link linkend="catalog-pg-opclass">
164 <database class="table">pg_opclass</database></link></entry>
165 <entry>index access method operator classes</entry>
169 <entry><link linkend="catalog-pg-operator">
170 <database class="table">pg_operator</database></link></entry>
171 <entry>operators</entry>
175 <entry><link linkend="catalog-pg-proc">
176 <database class="table">pg_proc</database></link></entry>
177 <entry>functions and procedures</entry>
181 <entry><link linkend="catalog-pg-rewrite">
182 <database class="table">pg_rewrite</database></link></entry>
183 <entry>query rewriter rules</entry>
187 <entry><link linkend="catalog-pg-shadow">
188 <database class="table">pg_shadow</database></link></entry>
189 <entry>database users</entry>
193 <entry><link linkend="catalog-pg-statistic">
194 <database class="table">pg_statistic</database></link></entry>
195 <entry>optimizer statistics</entry>
199 <entry><link linkend="catalog-pg-trigger">
200 <database class="table">pg_trigger</database></link></entry>
201 <entry>triggers</entry>
205 <entry><link linkend="catalog-pg-type">
206 <database class="table">pg_type</database></link></entry>
207 <entry>data types</entry>
214 More detailed documentation of each catalog follows below.
220 <sect1 id="catalog-pg-aggregate">
221 <title>pg_aggregate</title>
224 <structname>pg_aggregate</structname> stores information about
225 aggregate functions. An aggregate function is a function that
226 operates on a set of values (typically one column from each row
227 that matches a query condition) and returns a single value computed
228 from all these values. Typical aggregate functions are
229 <function>sum</function>, <function>count</function>, and
230 <function>max</function>. Each entry in
231 <structname>pg_aggregate</structname> is an extension of an entry
232 in <structname>pg_proc</structname>. The <structname>pg_proc</structname>
233 entry carries the aggregate's name, input and output datatypes, and
234 other information that is similar to ordinary functions.
238 <title>pg_aggregate Columns</title>
245 <entry>References</entry>
246 <entry>Description</entry>
251 <entry>aggfnoid</entry>
252 <entry><type>regproc</type></entry>
253 <entry>pg_proc.oid</entry>
254 <entry>pg_proc OID of the aggregate function</entry>
257 <entry>aggtransfn</entry>
258 <entry><type>regproc</type></entry>
259 <entry>pg_proc.oid</entry>
260 <entry>Transition function</entry>
263 <entry>aggfinalfn</entry>
264 <entry><type>regproc</type></entry>
265 <entry>pg_proc.oid</entry>
266 <entry>Final function (zero if none)</entry>
269 <entry>aggtranstype</entry>
270 <entry><type>oid</type></entry>
271 <entry>pg_type.oid</entry>
272 <entry>The type of the aggregate function's internal transition (state) data</entry>
275 <entry>agginitval</entry>
276 <entry><type>text</type></entry>
279 The initial value of the transition state. This is a text
280 field containing the initial value in its external string
281 representation. If the field is NULL, the transition state
282 value starts out NULL.
290 New aggregate functions are registered with the <command>CREATE
291 AGGREGATE</command> command. See the <citetitle>Programmer's
292 Guide</citetitle> for more information about writing aggregate
293 functions and the meaning of the transition functions, etc.
299 <sect1 id="catalog-pg-am">
303 <structname>pg_am</structname> stores information about index access
304 methods. There is one row for each index access method supported by
309 <title>pg_am Columns</title>
316 <entry>References</entry>
317 <entry>Description</entry>
323 <entry>amname</entry>
324 <entry><type>name</type></entry>
326 <entry>name of the access method</entry>
330 <entry>amowner</entry>
331 <entry><type>int4</type></entry>
332 <entry>pg_shadow.usesysid</entry>
333 <entry>user ID of the owner (currently not used)</entry>
337 <entry>amstrategies</entry>
338 <entry><type>int2</type></entry>
340 <entry>number of operator strategies for this access method</entry>
344 <entry>amsupport</entry>
345 <entry><type>int2</type></entry>
347 <entry>number of support routines for this access method</entry>
351 <entry>amorderstrategy</entry>
352 <entry><type>int2</type></entry>
354 <entry>zero if the index offers no sort order, otherwise the strategy
355 number of the strategy operator that describes the sort order</entry>
359 <entry>amcanunique</entry>
360 <entry><type>bool</type></entry>
362 <entry>does AM support unique indexes?</entry>
366 <entry>amcanmulticol</entry>
367 <entry><type>bool</type></entry>
369 <entry>does AM support multicolumn indexes?</entry>
373 <entry>amindexnulls</entry>
374 <entry><type>bool</type></entry>
376 <entry>does AM support NULL index entries?</entry>
380 <entry>amconcurrent</entry>
381 <entry><type>bool</type></entry>
383 <entry>does AM support concurrent updates?</entry>
387 <entry>amgettuple</entry>
388 <entry><type>regproc</type></entry>
389 <entry>pg_proc.oid</entry>
390 <entry><quote>next valid tuple</quote> function</entry>
394 <entry>aminsert</entry>
395 <entry><type>regproc</type></entry>
396 <entry>pg_proc.oid</entry>
397 <entry><quote>insert this tuple</quote> function</entry>
401 <entry>ambeginscan</entry>
402 <entry><type>regproc</type></entry>
403 <entry>pg_proc.oid</entry>
404 <entry><quote>start new scan</quote> function</entry>
408 <entry>amrescan</entry>
409 <entry><type>regproc</type></entry>
410 <entry>pg_proc.oid</entry>
411 <entry><quote>restart this scan</quote> function</entry>
415 <entry>amendscan</entry>
416 <entry><type>regproc</type></entry>
417 <entry>pg_proc.oid</entry>
418 <entry><quote>end this scan</quote> function</entry>
422 <entry>ammarkpos</entry>
423 <entry><type>regproc</type></entry>
424 <entry>pg_proc.oid</entry>
425 <entry><quote>mark current scan position</quote> function</entry>
429 <entry>amrestrpos</entry>
430 <entry><type>regproc</type></entry>
431 <entry>pg_proc.oid</entry>
432 <entry><quote>restore marked scan position</quote> function</entry>
436 <entry>ambuild</entry>
437 <entry><type>regproc</type></entry>
438 <entry>pg_proc.oid</entry>
439 <entry><quote>build new index</quote> function</entry>
443 <entry>ambulkdelete</entry>
444 <entry><type>regproc</type></entry>
445 <entry>pg_proc.oid</entry>
446 <entry>bulk-delete function</entry>
450 <entry>amcostestimate</entry>
451 <entry><type>regproc</type></entry>
452 <entry>pg_proc.oid</entry>
453 <entry>estimate cost of an indexscan</entry>
461 An index AM that supports multiple columns (has
462 <structfield>amcanmulticol</structfield> true) <emphasis>must</>
463 support indexing nulls in columns after the first, because the planner
464 will assume the index can be used for queries on just the first
465 column(s). For example, consider an index on (a,b) and a query
466 WHERE a = 4. The system will assume the index can be used to scan for
467 rows with a = 4, which is wrong if the index omits rows where b is null.
468 However it is okay to omit rows where the first indexed column is null.
469 (GiST currently does so.)
470 <structfield>amindexnulls</structfield> should be set true only if the
471 index AM indexes all rows, including arbitrary combinations of nulls.
477 <sect1 id="catalog-pg-amop">
478 <title>pg_amop</title>
481 <structname>pg_amop</structname> stores information about operators
482 associated with index access method operator classes. There is one
483 row for each operator that is a member of an operator class.
487 <title>pg_amop Columns</title>
494 <entry>References</entry>
495 <entry>Description</entry>
501 <entry>amopclaid</entry>
502 <entry><type>oid</type></entry>
503 <entry>pg_opclass.oid</entry>
504 <entry>the index opclass this entry is for</entry>
508 <entry>amopstrategy</entry>
509 <entry><type>int2</type></entry>
511 <entry>operator strategy number</entry>
515 <entry>amopreqcheck</entry>
516 <entry><type>bool</type></entry>
518 <entry>index hit must be rechecked</entry>
522 <entry>amopopr</entry>
523 <entry><type>oid</type></entry>
524 <entry>pg_operator.oid</entry>
525 <entry>the operator's pg_operator OID</entry>
535 <sect1 id="catalog-pg-amproc">
536 <title>pg_amproc</title>
539 <structname>pg_amproc</structname> stores information about support
541 associated with index access method operator classes. There is one
542 row for each support procedure belonging to an operator class.
546 <title>pg_amproc Columns</title>
553 <entry>References</entry>
554 <entry>Description</entry>
560 <entry>amopclaid</entry>
561 <entry><type>oid</type></entry>
562 <entry>pg_opclass.oid</entry>
563 <entry>the index opclass this entry is for</entry>
567 <entry>amprocnum</entry>
568 <entry><type>int2</type></entry>
570 <entry>support procedure index</entry>
574 <entry>amproc</entry>
575 <entry><type>regproc</type></entry>
576 <entry>pg_proc.oid</entry>
577 <entry>OID of the proc</entry>
587 <sect1 id="catalog-pg-attrdef">
588 <title>pg_attrdef</title>
591 This catalog stores column default values. The main information
592 about columns is stored in <structname>pg_attribute</structname>
593 (see below). Only columns that explicitly specify a default value
594 (when the table is created or the column is added) will have an
599 <title>pg_attrdef Columns</title>
606 <entry>References</entry>
607 <entry>Description</entry>
613 <entry>adrelid</entry>
614 <entry><type>oid</type></entry>
615 <entry>pg_class.oid</entry>
616 <entry>The table this column belongs to</entry>
621 <entry><type>int2</type></entry>
622 <entry>pg_attribute.attnum</entry>
623 <entry>The number of the column</entry>
628 <entry><type>text</type></entry>
630 <entry>An internal representation of the column default value</entry>
635 <entry><type>text</type></entry>
637 <entry>A human-readable representation of the default value</entry>
646 <sect1 id="catalog-pg-attribute">
647 <title>pg_attribute</title>
650 <structname>pg_attribute</structname> stores information about
651 table columns. There will be exactly one
652 <structname>pg_attribute</structname> row for every column in every
653 table in the database. (There will also be attribute entries for
654 indexes and other objects. See <structname>pg_class</structname>.)
658 The term attribute is equivalent to column and is used for
663 <title>pg_attribute Columns</title>
670 <entry>References</entry>
671 <entry>Description</entry>
677 <entry>attrelid</entry>
678 <entry><type>oid</type></entry>
679 <entry>pg_class.oid</entry>
680 <entry>The table this column belongs to</entry>
684 <entry>attname</entry>
685 <entry><type>name</type></entry>
687 <entry>Column name</entry>
691 <entry>atttypid</entry>
692 <entry><type>oid</type></entry>
693 <entry>pg_type.oid</entry>
694 <entry>The data type of this column</entry>
698 <entry>attstattarget</entry>
699 <entry><type>int4</type></entry>
702 <structfield>attstattarget</structfield> controls the level of detail
703 of statistics accumulated for this column by
704 <command>ANALYZE</command>.
705 A zero value indicates that no statistics should be collected.
706 A negative value says to use the system default statistics target.
707 The exact meaning of positive values is datatype-dependent.
708 For scalar datatypes, <structfield>attstattarget</structfield>
709 is both the target number of <quote>most common values</quote>
710 to collect, and the target number of histogram bins to create.
715 <entry>attlen</entry>
716 <entry><type>int2</type></entry>
720 <structname>pg_type</structname>.<structfield>typlen</structfield>
721 of this column's type.
726 <entry>attnum</entry>
727 <entry><type>int2</type></entry>
730 The number of the column. Ordinary columns are numbered from 1
731 up. System columns, such as <structfield>oid</structfield>,
732 have (arbitrary) negative numbers.
737 <entry>attndims</entry>
738 <entry><type>int4</type></entry>
741 Number of dimensions, if the column is an array type; otherwise 0.
742 (Presently, the number of dimensions of an array is not enforced,
743 so any nonzero value effectively means <quote>it's an array</>.)
748 <entry>attcacheoff</entry>
749 <entry><type>int4</type></entry>
752 Always -1 in storage, but when loaded into a tuple descriptor
753 in memory this may be updated to cache the offset of the attribute
759 <entry>atttypmod</entry>
760 <entry><type>int4</type></entry>
763 <structfield>atttypmod</structfield> records type-specific data
764 supplied at table creation time (for example, the maximum
765 length of a <type>varchar</type> column). It is passed to
766 type-specific input functions and length coercion functions.
767 The value will generally be -1 for types that do not need typmod.
772 <entry>attbyval</entry>
773 <entry><type>bool</type></entry>
777 <structname>pg_type</structname>.<structfield>typbyval</structfield>
778 of this column's type
783 <entry>attstorage</entry>
784 <entry><type>char</type></entry>
788 <structname>pg_type</structname>.<structfield>typstorage</structfield>
789 of this column's type. For TOASTable datatypes, this can be altered
790 after column creation to control storage policy.
795 <entry>attisset</entry>
796 <entry><type>bool</type></entry>
799 If true, this attribute is a set. In that case, what is really
800 stored in the attribute is the OID of a tuple in the
801 <structname>pg_proc</structname> catalog. The
802 <structname>pg_proc</structname> tuple contains the query
803 string that defines this set - i.e., the query to run to get
804 the set. So the <structfield>atttypid</structfield> (see
805 above) refers to the type returned by this query, but the
806 actual length of this attribute is the length (size) of an
807 <type>oid</type>. --- At least this is the theory. All this
808 is probably quite broken these days.
813 <entry>attalign</entry>
814 <entry><type>char</type></entry>
818 <structname>pg_type</structname>.<structfield>typalign</structfield>
819 of this column's type
824 <entry>attnotnull</entry>
825 <entry><type>bool</type></entry>
828 This represents a NOT NULL constraint. It is possible to
829 change this field to enable or disable the constraint.
834 <entry>atthasdef</entry>
835 <entry><type>bool</type></entry>
838 This column has a default value, in which case there will be a
839 corresponding entry in the <structname>pg_attrdef</structname>
840 catalog that actually defines the value.
845 <entry>attisdropped</entry>
846 <entry><type>bool</type></entry>
849 This column has been dropped and is no longer valid. A dropped
850 column is still physically present in the table, but is
851 ignored by the parser and so cannot be accessed via SQL.
856 <entry>attislocal</entry>
857 <entry><type>bool</type></entry>
860 This column is defined locally in the relation. Note that a column may
861 be locally defined and inherited simultaneously.
866 <entry>attinhcount</entry>
867 <entry><type>int4</type></entry>
870 The number of direct ancestors this column has. A column with a
871 nonzero number of ancestors cannot be dropped nor renamed.
881 <sect1 id="catalog-pg-cast">
882 <title>pg_cast</title>
885 <structname>pg_cast</structname> stores data type conversion paths,
886 both built-in paths and those defined with <command>CREATE CAST</command>.
890 <title>pg_cast Columns</title>
897 <entry>References</entry>
898 <entry>Description</entry>
904 <entry>castsource</entry>
905 <entry><type>oid</type></entry>
906 <entry>pg_type.oid</entry>
907 <entry>OID of the source data type</entry>
911 <entry>casttarget</entry>
912 <entry><type>oid</type></entry>
913 <entry>pg_type.oid</entry>
914 <entry>OID of the target data type</entry>
918 <entry>castfunc</entry>
919 <entry><type>oid</type></entry>
920 <entry>pg_proc.oid</entry>
922 The OID of the function to use to perform this cast. Zero is
923 stored if the data types are binary coercible (that is, no
924 run-time operation is needed to perform the cast).
929 <entry>castcontext</entry>
930 <entry><type>char</type></entry>
933 Indicates what contexts the cast may be invoked in.
934 <literal>e</> means only as an explicit cast (using
935 <literal>CAST</>, <literal>::</>, or function-call syntax).
936 <literal>a</> means implicitly in assignment
937 to a target column, as well as explicitly.
938 <literal>i</> means implicitly in expressions, as well as the
947 <sect1 id="catalog-pg-class">
948 <title>pg_class</title>
951 <structname>pg_class</structname> catalogs tables and most
952 everything else that has columns or is otherwise similar to a
953 table. This includes indexes (but see also
954 <structname>pg_index</structname>), sequences, views, and some
955 kinds of special relation; see <structfield>relkind</>.
956 Below, when we mean all of these
957 kinds of objects we speak of <quote>relations</quote>. Not all
958 fields are meaningful for all relation types.
962 <title>pg_class Columns</title>
969 <entry>References</entry>
970 <entry>Description</entry>
976 <entry>relname</entry>
977 <entry><type>name</type></entry>
979 <entry>Name of the table, index, view, etc.</entry>
983 <entry>relnamespace</entry>
984 <entry><type>oid</type></entry>
985 <entry>pg_namespace.oid</entry>
987 The OID of the namespace that contains this relation
992 <entry>reltype</entry>
993 <entry><type>oid</type></entry>
994 <entry>pg_type.oid</entry>
996 The OID of the data type that corresponds to this table, if any
997 (zero for indexes, which have no pg_type entry)
1002 <entry>relowner</entry>
1003 <entry><type>int4</type></entry>
1004 <entry>pg_shadow.usesysid</entry>
1005 <entry>Owner of the relation</entry>
1009 <entry>relam</entry>
1010 <entry><type>oid</type></entry>
1011 <entry>pg_am.oid</entry>
1012 <entry>If this is an index, the access method used (B-tree, hash, etc.)</entry>
1016 <entry>relfilenode</entry>
1017 <entry><type>oid</type></entry>
1019 <entry>Name of the on-disk file of this relation; 0 if none</entry>
1023 <entry>relpages</entry>
1024 <entry><type>int4</type></entry>
1027 Size of the on-disk representation of this table in pages (size
1028 <symbol>BLCKSZ</symbol>).
1029 This is only an estimate used by the planner.
1030 It is updated by <command>VACUUM</command>,
1031 <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
1036 <entry>reltuples</entry>
1037 <entry><type>float4</type></entry>
1040 Number of tuples in the table.
1041 This is only an estimate used by the planner.
1042 It is updated by <command>VACUUM</command>,
1043 <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
1048 <entry>reltoastrelid</entry>
1049 <entry><type>oid</type></entry>
1050 <entry>pg_class.oid</entry>
1052 OID of the TOAST table associated with this table, 0 if none.
1053 The TOAST table stores large attributes <quote>out of
1054 line</quote> in a secondary table.
1059 <entry>reltoastidxid</entry>
1060 <entry><type>oid</type></entry>
1061 <entry>pg_class.oid</entry>
1063 For a TOAST table, the OID of its index. 0 if not a TOAST table.
1068 <entry>relhasindex</entry>
1069 <entry><type>bool</type></entry>
1071 <entry>True if this is a table and it has (or recently had) any indexes.
1072 This is set by CREATE INDEX, but not cleared immediately by DROP INDEX.
1073 VACUUM clears relhasindex if it finds the table has no indexes.
1078 <entry>relisshared</entry>
1079 <entry><type>bool</type></entry>
1081 <entry>True if this table is shared across all databases in the
1082 cluster. Only certain system catalogs (such as
1083 <structname>pg_database</structname>) are shared.</entry>
1087 <entry>relkind</entry>
1088 <entry><type>char</type></entry>
1091 'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
1092 'c' = composite type, 's' = special, 't' = TOAST table
1097 <entry>relnatts</entry>
1098 <entry><type>int2</type></entry>
1101 Number of user columns in the relation (system columns not counted).
1102 There must be this many corresponding entries in
1103 <structname>pg_attribute</structname>. See also
1104 <structname>pg_attribute</structname>.<structfield>attnum</structfield>.
1109 <entry>relchecks</entry>
1110 <entry><type>int2</type></entry>
1113 Number of check constraints on the table; see
1114 <structname>pg_constraint</structname> catalog
1119 <entry>reltriggers</entry>
1120 <entry><type>int2</type></entry>
1123 Number of triggers on the table; see
1124 <structname>pg_trigger</structname> catalog
1129 <entry>relukeys</entry>
1130 <entry><type>int2</type></entry>
1132 <entry>unused (<emphasis>Not</emphasis> the number of unique keys)</entry>
1136 <entry>relfkeys</entry>
1137 <entry><type>int2</type></entry>
1139 <entry>unused (<emphasis>Not</emphasis> the number of foreign keys on the table)</entry>
1143 <entry>relrefs</entry>
1144 <entry><type>int2</type></entry>
1146 <entry>unused</entry>
1150 <entry>relhasoids</entry>
1151 <entry><type>bool</type></entry>
1154 True if we generate an OID for each row of the relation.
1159 <entry>relhaspkey</entry>
1160 <entry><type>bool</type></entry>
1163 True if the table has (or once had) a primary key.
1168 <entry>relhasrules</entry>
1169 <entry><type>bool</type></entry>
1171 <entry>Table has rules; see
1172 <structname>pg_rewrite</structname> catalog
1177 <entry>relhassubclass</entry>
1178 <entry><type>bool</type></entry>
1180 <entry>At least one table inherits from this one</entry>
1184 <entry>relacl</entry>
1185 <entry><type>aclitem[]</type></entry>
1188 Access permissions. See the descriptions of
1189 <command>GRANT</command> and <command>REVOKE</command> for
1198 <sect1 id="catalog-pg-constraint">
1199 <title>pg_constraint</title>
1202 This system catalog stores CHECK, PRIMARY KEY, UNIQUE, and FOREIGN KEY
1203 constraints on tables. (Column
1204 constraints are not treated specially. Every column constraint is
1205 equivalent to some table constraint.) See under <command>CREATE
1206 TABLE</command> for more information.
1211 NOT NULL constraints are represented in the <structname>pg_attribute</>
1217 CHECK constraints on domains are stored here, too. Global ASSERTIONS
1218 (a currently-unsupported SQL feature) may someday appear here as well.
1222 <title>pg_constraint Columns</title>
1229 <entry>References</entry>
1230 <entry>Description</entry>
1236 <entry>conname</entry>
1237 <entry><type>name</type></entry>
1239 <entry>Constraint name (not necessarily unique!)</entry>
1243 <entry>connamespace</entry>
1244 <entry><type>oid</type></entry>
1245 <entry>pg_namespace.oid</entry>
1247 The OID of the namespace that contains this constraint
1252 <entry>contype</entry>
1253 <entry><type>char</type></entry>
1256 'c' = check constraint,
1257 'f' = foreign key constraint,
1258 'p' = primary key constraint,
1259 'u' = unique constraint
1264 <entry>condeferrable</entry>
1265 <entry><type>boolean</type></entry>
1267 <entry>Is the constraint deferrable?</entry>
1271 <entry>condeferred</entry>
1272 <entry><type>boolean</type></entry>
1274 <entry>Is the constraint deferred by default?</entry>
1278 <entry>conrelid</entry>
1279 <entry><type>oid</type></entry>
1280 <entry>pg_class.oid</entry>
1281 <entry>The table this constraint is on; 0 if not a table constraint</entry>
1285 <entry>contypid</entry>
1286 <entry><type>oid</type></entry>
1287 <entry>pg_type.oid</entry>
1288 <entry>The domain this constraint is on; 0 if not a domain constraint</entry>
1292 <entry>confrelid</entry>
1293 <entry><type>oid</type></entry>
1294 <entry>pg_class.oid</entry>
1295 <entry>If a foreign key, the referenced table; else 0</entry>
1299 <entry>confupdtype</entry>
1300 <entry><type>char</type></entry>
1302 <entry>Foreign key update action code</entry>
1306 <entry>confdeltype</entry>
1307 <entry><type>char</type></entry>
1309 <entry>Foreign key deletion action code</entry>
1313 <entry>confmatchtype</entry>
1314 <entry><type>char</type></entry>
1316 <entry>Foreign key match type</entry>
1320 <entry>conkey</entry>
1321 <entry><type>int2[]</type></entry>
1322 <entry>pg_attribute.attnum</entry>
1323 <entry>If a table constraint, list of columns which the constraint constrains</entry>
1327 <entry>confkey</entry>
1328 <entry><type>int2[]</type></entry>
1329 <entry>pg_attribute.attnum</entry>
1330 <entry>If a foreign key, list of the referenced columns</entry>
1334 <entry>conbin</entry>
1335 <entry><type>text</type></entry>
1337 <entry>If a check constraint, an internal representation of the expression</entry>
1341 <entry>consrc</entry>
1342 <entry><type>text</type></entry>
1344 <entry>If a check constraint, a human-readable representation of the expression</entry>
1352 <structname>pg_class</structname>.<structfield>relchecks</structfield>
1353 needs to agree with the number of check-constraint entries found in this
1354 table for the given relation.
1360 <sect1 id="catalog-pg-conversion">
1361 <title>pg_conversion</title>
1364 This system catalog stores encoding conversion information. See
1365 <command>CREATE CONVERSION</command> for more information.
1369 <title>pg_conversion Columns</title>
1376 <entry>References</entry>
1377 <entry>Description</entry>
1383 <entry>conname</entry>
1384 <entry><type>name</type></entry>
1386 <entry>Conversion name (unique within a namespace)</entry>
1390 <entry>connamespace</entry>
1391 <entry><type>oid</type></entry>
1392 <entry>pg_namespace.oid</entry>
1394 The OID of the namespace that contains this conversion
1399 <entry>conowner</entry>
1400 <entry><type>int4</type></entry>
1401 <entry>pg_shadow.usesysid</entry>
1402 <entry>Owner (creator) of the namespace</entry>
1406 <entry>conforencoding</entry>
1407 <entry><type>int4</type></entry>
1409 <entry>Source(for) encoding ID</entry>
1413 <entry>contoencoding</entry>
1414 <entry><type>int4</type></entry>
1416 <entry>Destination(to) encoding ID</entry>
1420 <entry>conproc</entry>
1421 <entry><type>regproc</type></entry>
1422 <entry>pg_proc.oid</entry>
1423 <entry>Conversion procedure</entry>
1427 <entry>condefault</entry>
1428 <entry><type>boolean</type></entry>
1430 <entry>true if this is the default conversion</entry>
1439 <sect1 id="catalog-pg-database">
1440 <title>pg_database</title>
1443 The <structname>pg_database</structname> catalog stores information
1444 about the available databases. Databases are created with the
1445 <command>CREATE DATABASE</command> command. Consult the
1446 <citetitle>Administrator's Guide</citetitle> for details about the
1447 meaning of some of the parameters.
1451 Unlike most system catalogs, <structname>pg_database</structname>
1452 is shared across all databases of a cluster: there is only one
1453 copy of <structname>pg_database</structname> per cluster, not
1458 <title>pg_database Columns</title>
1465 <entry>References</entry>
1466 <entry>Description</entry>
1472 <entry>datname</entry>
1473 <entry><type>name</type></entry>
1475 <entry>Database name</entry>
1479 <entry>datdba</entry>
1480 <entry><type>int4</type></entry>
1481 <entry>pg_shadow.usesysid</entry>
1482 <entry>Owner of the database, usually the user who created it</entry>
1486 <entry>encoding</entry>
1487 <entry><type>int4</type></entry>
1489 <entry>Character/multibyte encoding for this database</entry>
1493 <entry>datistemplate</entry>
1494 <entry><type>bool</type></entry>
1497 If true then this database can be used in the
1498 <quote>TEMPLATE</quote> clause of <command>CREATE
1499 DATABASE</command> to create a new database as a clone of
1505 <entry>datallowconn</entry>
1506 <entry><type>bool</type></entry>
1509 If false then no one can connect to this database. This is
1510 used to protect the template0 database from being altered.
1515 <entry>datlastsysoid</entry>
1516 <entry><type>oid</type></entry>
1519 Last system OID in the database; useful
1520 particularly to <application>pg_dump</application>
1525 <entry>datvacuumxid</entry>
1526 <entry><type>xid</type></entry>
1529 All tuples inserted or deleted by transaction IDs before this one
1530 have been marked as known committed or known aborted in this database.
1531 This is used to determine when commit-log space can be recycled.
1536 <entry>datfrozenxid</entry>
1537 <entry><type>xid</type></entry>
1540 All tuples inserted by transaction IDs before this one have been
1541 relabeled with a permanent (<quote>frozen</>) transaction ID in this
1542 database. This is useful to check whether a database must be vacuumed
1543 soon to avoid transaction ID wraparound problems.
1548 <entry>datpath</entry>
1549 <entry><type>text</type></entry>
1552 If the database is stored at an alternative location then this
1553 records the location. It's either an environment variable name
1554 or an absolute path, depending how it was entered.
1559 <entry>datconfig</entry>
1560 <entry><type>text[]</type></entry>
1562 <entry>Session defaults for run-time configuration variables</entry>
1566 <entry>datacl</entry>
1567 <entry><type>aclitem[]</type></entry>
1569 <entry>Access permissions</entry>
1577 <sect1 id="catalog-pg-depend">
1578 <title>pg_depend</title>
1581 The <structname>pg_depend</structname> table records the dependency
1582 relationships between database objects. This information allows
1583 <command>DROP</> commands to find which other objects must be dropped
1584 by <command>DROP CASCADE</>, or prevent dropping in the <command>DROP
1589 <title>pg_depend Columns</title>
1596 <entry>References</entry>
1597 <entry>Description</entry>
1603 <entry>classid</entry>
1604 <entry><type>oid</type></entry>
1605 <entry>pg_class.oid</entry>
1606 <entry>The oid of the system catalog the dependent object is in</entry>
1610 <entry>objid</entry>
1611 <entry><type>oid</type></entry>
1612 <entry>any oid attribute</entry>
1613 <entry>The oid of the specific dependent object</entry>
1617 <entry>objsubid</entry>
1618 <entry><type>int4</type></entry>
1620 <entry>For a table attribute, this is the attribute's
1621 column number (the objid and classid refer to the table itself).
1622 For all other object types, this field is presently zero.
1627 <entry>refclassid</entry>
1628 <entry><type>oid</type></entry>
1629 <entry>pg_class.oid</entry>
1630 <entry>The oid of the system catalog the referenced object is in</entry>
1634 <entry>refobjid</entry>
1635 <entry><type>oid</type></entry>
1636 <entry>any oid attribute</entry>
1637 <entry>The oid of the specific referenced object</entry>
1641 <entry>refobjsubid</entry>
1642 <entry><type>int4</type></entry>
1644 <entry>For a table attribute, this is the attribute's
1645 column number (the refobjid and refclassid refer to the table itself).
1646 For all other object types, this field is presently zero.
1651 <entry>deptype</entry>
1652 <entry><type>char</type></entry>
1655 A code defining the specific semantics of this dependency relationship.
1664 In all cases, a <structname>pg_depend</structname> entry indicates that the
1665 referenced object may not be dropped without also dropping the dependent
1666 object. However, there are several subflavors identified by
1667 <structfield>deptype</>:
1672 DEPENDENCY_NORMAL ('n'): normal relationship between separately-created
1673 objects. The dependent object may be dropped without affecting the
1674 referenced object. The referenced object may only be dropped by
1675 specifying CASCADE, in which case the dependent object is dropped too.
1676 Example: a table column has a normal dependency on its datatype.
1682 DEPENDENCY_AUTO ('a'): the dependent object can be dropped separately
1683 from the referenced object, and should be automatically dropped
1684 (regardless of RESTRICT or CASCADE mode) if the referenced object
1686 Example: a named constraint on a table is made auto-dependent on
1687 the table, so that it will go away if the table is dropped.
1693 DEPENDENCY_INTERNAL ('i'): the dependent object was created as part
1694 of creation of the referenced object, and is really just a part of
1695 its internal implementation. A DROP of the dependent object will be
1696 disallowed outright (we'll tell the user to issue a DROP against the
1697 referenced object, instead). A DROP of the referenced object will be
1698 propagated through to drop the dependent object whether CASCADE is
1700 Example: a trigger that's created to enforce a foreign-key constraint
1701 is made internally dependent on the constraint's pg_constraint entry.
1707 DEPENDENCY_PIN ('p'): there is no dependent object; this type of entry
1708 is a signal that the system itself depends on the referenced object,
1709 and so that object must never be deleted. Entries of this type are
1710 created only during initdb. The fields for the dependent object
1716 Other dependency flavors may be needed in future.
1722 <sect1 id="catalog-pg-description">
1723 <title>pg_description</title>
1726 The pg_description table can store an optional description or
1727 comment for each database object. Descriptions can be manipulated
1728 with the <command>COMMENT</command> command and viewed with
1729 <application>psql</application>'s <literal>\d</literal> commands.
1730 Descriptions of many built-in system objects are provided in the initial
1731 contents of pg_description.
1735 <title>pg_description Columns</title>
1742 <entry>References</entry>
1743 <entry>Description</entry>
1749 <entry>objoid</entry>
1750 <entry><type>oid</type></entry>
1751 <entry>any oid attribute</entry>
1752 <entry>The oid of the object this description pertains to</entry>
1756 <entry>classoid</entry>
1757 <entry><type>oid</type></entry>
1758 <entry>pg_class.oid</entry>
1759 <entry>The oid of the system catalog this object appears in</entry>
1763 <entry>objsubid</entry>
1764 <entry><type>int4</type></entry>
1766 <entry>For a comment on a table attribute, this is the attribute's
1767 column number (the objoid and classoid refer to the table itself).
1768 For all other object types, this field is presently zero.
1773 <entry>description</entry>
1774 <entry><type>text</type></entry>
1776 <entry>Arbitrary text that serves as the description of this object.</entry>
1785 <sect1 id="catalog-pg-group">
1786 <title>pg_group</title>
1789 This catalog defines groups and stores what users belong to what
1790 groups. Groups are created with the <command>CREATE
1791 GROUP</command> command. Consult the <citetitle>Administrator's
1792 Guide</citetitle> for information about user permission management.
1796 Because user and group identities are cluster-wide,
1797 <structname>pg_group</structname>
1798 is shared across all databases of a cluster: there is only one
1799 copy of <structname>pg_group</structname> per cluster, not
1804 <title>pg_group Columns</title>
1811 <entry>References</entry>
1812 <entry>Description</entry>
1818 <entry>groname</entry>
1819 <entry><type>name</type></entry>
1821 <entry>Name of the group</entry>
1825 <entry>grosysid</entry>
1826 <entry><type>int4</type></entry>
1828 <entry>An arbitrary number to identify this group</entry>
1832 <entry>grolist</entry>
1833 <entry><type>int4[]</type></entry>
1834 <entry>pg_shadow.usesysid</entry>
1835 <entry>An array containing the ids of the users in this group</entry>
1844 <sect1 id="catalog-pg-index">
1845 <title>pg_index</title>
1848 <structname>pg_index</structname> contains part of the information
1849 about indexes. The rest is mostly in
1850 <structname>pg_class</structname>.
1854 <title>pg_index Columns</title>
1861 <entry>References</entry>
1862 <entry>Description</entry>
1868 <entry>indexrelid</entry>
1869 <entry><type>oid</type></entry>
1870 <entry>pg_class.oid</entry>
1871 <entry>The OID of the pg_class entry for this index</entry>
1875 <entry>indrelid</entry>
1876 <entry><type>oid</type></entry>
1877 <entry>pg_class.oid</entry>
1878 <entry>The OID of the pg_class entry for the table this index is for</entry>
1882 <entry>indproc</entry>
1883 <entry><type>regproc</type></entry>
1884 <entry>pg_proc.oid</entry>
1885 <entry>The function's OID if this is a functional index,
1890 <entry>indkey</entry>
1891 <entry><type>int2vector</type></entry>
1892 <entry>pg_attribute.attnum</entry>
1894 This is a vector (array) of up to
1895 <symbol>INDEX_MAX_KEYS</symbol> values that indicate which
1896 table columns this index pertains to. For example a value of
1897 <literal>1 3</literal> would mean that the first and the third
1898 column make up the index key. For a functional index, these
1899 columns are the inputs to the function, and the function's return
1900 value is the index key.
1905 <entry>indclass</entry>
1906 <entry><type>oidvector</type></entry>
1907 <entry>pg_opclass.oid</entry>
1909 For each column in the index key this contains a reference to
1910 the <quote>operator class</quote> to use. See
1911 <structname>pg_opclass</structname> for details.
1916 <entry>indisclustered</entry>
1917 <entry><type>bool</type></entry>
1919 <entry>If true, the table was last clustered on this index.</entry>
1923 <entry>indisunique</entry>
1924 <entry><type>bool</type></entry>
1926 <entry>If true, this is a unique index.</entry>
1930 <entry>indisprimary</entry>
1931 <entry><type>bool</type></entry>
1933 <entry>If true, this index represents the primary key of the table.
1934 (indisunique should always be true when this is true.)</entry>
1938 <entry>indreference</entry>
1939 <entry><type>oid</type></entry>
1941 <entry>unused</entry>
1945 <entry>indpred</entry>
1946 <entry><type>text</type></entry>
1948 <entry>Expression tree (in the form of a nodeToString representation)
1949 for partial index predicate. Empty string if not a partial
1959 <sect1 id="catalog-pg-inherits">
1960 <title>pg_inherits</title>
1963 This catalog records information about table inheritance hierarchies.
1967 <title>pg_inherits Columns</title>
1974 <entry>References</entry>
1975 <entry>Description</entry>
1981 <entry>inhrelid</entry>
1982 <entry><type>oid</type></entry>
1983 <entry>pg_class.oid</entry>
1985 The OID of the child table.
1990 <entry>inhparent</entry>
1991 <entry><type>oid</type></entry>
1992 <entry>pg_class.oid</entry>
1994 The OID of the parent table.
1999 <entry>inhseqno</entry>
2000 <entry><type>int4</type></entry>
2003 If there is more than one parent for a child table (multiple
2004 inheritance), this number tells the order in which the
2005 inherited columns are to be arranged. The count starts at 1.
2015 <sect1 id="catalog-pg-language">
2016 <title>pg_language</title>
2019 <structname>pg_language</structname> registers call interfaces or
2020 languages in which you can write functions or stored procedures.
2021 See under <command>CREATE LANGUAGE</command> and in the
2022 <citetitle>Programmer's Guide</citetitle> for more information
2023 about language handlers.
2027 <title>pg_language Columns</title>
2034 <entry>References</entry>
2035 <entry>Description</entry>
2041 <entry>lanname</entry>
2042 <entry><type>name</type></entry>
2044 <entry>Name of the language (to be specified when creating a function)</entry>
2048 <entry>lanispl</entry>
2049 <entry><type>bool</type></entry>
2052 This is false for internal languages (such as SQL) and true for
2053 user-defined languages. Currently,
2054 <application>pg_dump</application> still uses this to determine
2055 which languages need to be dumped, but this may be replaced by
2056 a different mechanism sometime.
2061 <entry>lanpltrusted</entry>
2062 <entry><type>bool</type></entry>
2065 This is a trusted language. See under <command>CREATE
2066 LANGUAGE</command> what this means. If this is an internal
2067 language (<structfield>lanispl</structfield> is false) then
2068 this field is meaningless.
2073 <entry>lanplcallfoid</entry>
2074 <entry><type>oid</type></entry>
2075 <entry>pg_proc.oid</entry>
2077 For non-internal languages this references the language
2078 handler, which is a special function that is responsible for
2079 executing all functions that are written in the particular
2085 <entry>lanvalidator</entry>
2086 <entry><type>oid</type></entry>
2087 <entry>pg_proc.oid</entry>
2089 This references a language validator function that is responsible
2090 for checking the syntax and validity of new functions when they
2091 are created. See under <command>CREATE LANGUAGE</command> for
2092 further information about validators.
2097 <entry>lanacl</entry>
2098 <entry><type>aclitem[]</type></entry>
2100 <entry>Access permissions</entry>
2109 <sect1 id="catalog-pg-largeobject">
2110 <title>pg_largeobject</title>
2113 <structname>pg_largeobject</structname> holds the data making up
2114 <quote>large objects</quote>. A large object is identified by an
2115 OID assigned when it is created. Each large object is broken into
2116 segments or <quote>pages</> small enough to be conveniently stored as rows
2117 in <structname>pg_largeobject</structname>.
2118 The amount of data per page is defined to be LOBLKSIZE (which is currently
2119 BLCKSZ/4, or typically 2Kbytes).
2123 <title>pg_largeobject Columns</title>
2130 <entry>References</entry>
2131 <entry>Description</entry>
2138 <entry><type>oid</type></entry>
2140 <entry>Identifier of the large object that includes this page</entry>
2144 <entry>pageno</entry>
2145 <entry><type>int4</type></entry>
2147 <entry>Page number of this page within its large object
2148 (counting from zero)</entry>
2153 <entry><type>bytea</type></entry>
2156 Actual data stored in the large object.
2157 This will never be more than LOBLKSIZE bytes, and may be less.
2165 Each row of <structname>pg_largeobject</structname> holds data
2166 for one page of a large object, beginning at
2167 byte offset (pageno * LOBLKSIZE) within the object. The implementation
2168 allows sparse storage: pages may be missing, and may be shorter than
2169 LOBLKSIZE bytes even if they are not the last page of the object.
2170 Missing regions within a large object read as zeroes.
2176 <sect1 id="catalog-pg-listener">
2177 <title>pg_listener</title>
2180 <structname>pg_listener</structname> supports the <command>LISTEN</>
2181 and <command>NOTIFY</> commands. A listener creates an entry in
2182 <structname>pg_listener</structname> for each notification name
2183 it is listening for. A notifier scans <structname>pg_listener</structname>
2184 and updates each matching entry to show that a notification has occurred.
2185 The notifier also sends a signal (using the PID recorded in the table)
2186 to awaken the listener from sleep.
2190 <title>pg_listener Columns</title>
2197 <entry>References</entry>
2198 <entry>Description</entry>
2204 <entry>relname</entry>
2205 <entry><type>name</type></entry>
2207 <entry>Notify condition name. (The name need not match any actual
2208 relation in the database; the term <quote>relname</> is historical.)
2213 <entry>listenerpid</entry>
2214 <entry><type>int4</type></entry>
2216 <entry>PID of the backend process that created this entry.</entry>
2220 <entry>notification</entry>
2221 <entry><type>int4</type></entry>
2224 Zero if no event is pending for this listener. If an event is
2225 pending, the PID of the backend that sent the notification.
2235 <sect1 id="catalog-pg-namespace">
2236 <title>pg_namespace</title>
2239 A namespace is the structure underlying SQL92 schemas: each namespace
2240 can have a separate collection of relations, types, etc without name
2245 <title>pg_namespace Columns</title>
2252 <entry>References</entry>
2253 <entry>Description</entry>
2259 <entry>nspname</entry>
2260 <entry><type>name</type></entry>
2262 <entry>Name of the namespace</entry>
2266 <entry>nspowner</entry>
2267 <entry><type>int4</type></entry>
2268 <entry>pg_shadow.usesysid</entry>
2269 <entry>Owner (creator) of the namespace</entry>
2273 <entry>nspacl</entry>
2274 <entry><type>aclitem[]</type></entry>
2276 <entry>Access permissions</entry>
2285 <sect1 id="catalog-pg-opclass">
2286 <title>pg_opclass</title>
2289 <structname>pg_opclass</structname> defines
2290 index access method operator classes. Each operator class defines
2291 semantics for index columns of a particular datatype and a particular
2292 index access method. Note that there can be multiple operator classes
2293 for a given datatype/access method combination, thus supporting multiple
2298 Operator classes are described at length in the
2299 <citetitle>Programmer's Guide</citetitle>.
2303 <title>pg_opclass Columns</title>
2310 <entry>References</entry>
2311 <entry>Description</entry>
2317 <entry>opcamid</entry>
2318 <entry><type>oid</type></entry>
2319 <entry>pg_am.oid</entry>
2320 <entry>index access method opclass is for</entry>
2324 <entry>opcname</entry>
2325 <entry><type>name</type></entry>
2327 <entry>name of this opclass</entry>
2331 <entry>opcnamespace</entry>
2332 <entry><type>oid</type></entry>
2333 <entry>pg_namespace.oid</entry>
2334 <entry>namespace of this opclass</entry>
2338 <entry>opcowner</entry>
2339 <entry><type>int4</type></entry>
2340 <entry>pg_shadow.usesysid</entry>
2341 <entry>opclass owner</entry>
2345 <entry>opcintype</entry>
2346 <entry><type>oid</type></entry>
2347 <entry>pg_type.oid</entry>
2348 <entry>type of input data for opclass</entry>
2352 <entry>opcdefault</entry>
2353 <entry><type>bool</type></entry>
2355 <entry>true if opclass is default for opcintype</entry>
2359 <entry>opckeytype</entry>
2360 <entry><type>oid</type></entry>
2361 <entry>pg_type.oid</entry>
2362 <entry>type of index data, or zero if same as opcintype</entry>
2370 The majority of the information defining an operator class is actually
2371 not in its <structname>pg_opclass</structname> row, but in the associated
2372 rows in <structname>pg_amop</structname> and
2373 <structname>pg_amproc</structname>. Those rows are considered to be
2374 part of the operator class definition --- this is not unlike the way
2375 that a relation is defined by a single <structname>pg_class</structname>
2376 row, plus associated rows in <structname>pg_attribute</structname> and
2383 <sect1 id="catalog-pg-operator">
2384 <title>pg_operator</title>
2387 See <command>CREATE OPERATOR</command> and the
2388 <citetitle>Programmer's Guide</citetitle> for details on these
2389 operator parameters.
2393 <title>pg_operator Columns</title>
2400 <entry>References</entry>
2401 <entry>Description</entry>
2407 <entry>oprname</entry>
2408 <entry><type>name</type></entry>
2410 <entry>Name of the operator</entry>
2414 <entry>oprnamespace</entry>
2415 <entry><type>oid</type></entry>
2416 <entry>pg_namespace.oid</entry>
2418 The OID of the namespace that contains this operator
2423 <entry>oprowner</entry>
2424 <entry><type>int4</type></entry>
2425 <entry>pg_shadow.usesysid</entry>
2426 <entry>Owner (creator) of the operator</entry>
2430 <entry>oprkind</entry>
2431 <entry><type>char</type></entry>
2434 'b' = infix (<quote>both</quote>), 'l' = prefix
2435 (<quote>left</quote>), 'r' = postfix (<quote>right</quote>)
2440 <entry>oprcanhash</entry>
2441 <entry><type>bool</type></entry>
2443 <entry>This operator supports hash joins.</entry>
2447 <entry>oprleft</entry>
2448 <entry><type>oid</type></entry>
2449 <entry>pg_type.oid</entry>
2450 <entry>Type of the left operand</entry>
2454 <entry>oprright</entry>
2455 <entry><type>oid</type></entry>
2456 <entry>pg_type.oid</entry>
2457 <entry>Type of the right operand</entry>
2461 <entry>oprresult</entry>
2462 <entry><type>oid</type></entry>
2463 <entry>pg_type.oid</entry>
2464 <entry>Type of the result</entry>
2468 <entry>oprcom</entry>
2469 <entry><type>oid</type></entry>
2470 <entry>pg_operator.oid</entry>
2471 <entry>Commutator of this operator, if any</entry>
2475 <entry>oprnegate</entry>
2476 <entry><type>oid</type></entry>
2477 <entry>pg_operator.oid</entry>
2478 <entry>Negator of this operator, if any</entry>
2482 <entry>oprlsortop</entry>
2483 <entry><type>oid</type></entry>
2484 <entry>pg_operator.oid</entry>
2486 If this operator supports merge joins, the operator that sorts
2487 the type of the left-hand operand (<literal>L<L</>)
2492 <entry>oprrsortop</entry>
2493 <entry><type>oid</type></entry>
2494 <entry>pg_operator.oid</entry>
2496 If this operator supports merge joins, the operator that sorts
2497 the type of the right-hand operand (<literal>R<R</>)
2502 <entry>oprltcmpop</entry>
2503 <entry><type>oid</type></entry>
2504 <entry>pg_operator.oid</entry>
2506 If this operator supports merge joins, the less-than operator that
2507 compares the left and right operand types (<literal>L<R</>)
2512 <entry>oprgtcmpop</entry>
2513 <entry><type>oid</type></entry>
2514 <entry>pg_operator.oid</entry>
2516 If this operator supports merge joins, the greater-than operator that
2517 compares the left and right operand types (<literal>L>R</>)
2522 <entry>oprcode</entry>
2523 <entry><type>regproc</type></entry>
2524 <entry>pg_proc.oid</entry>
2525 <entry>Function that implements this operator</entry>
2529 <entry>oprrest</entry>
2530 <entry><type>regproc</type></entry>
2531 <entry>pg_proc.oid</entry>
2532 <entry>Restriction selectivity estimation function for this operator</entry>
2536 <entry>oprjoin</entry>
2537 <entry><type>regproc</type></entry>
2538 <entry>pg_proc.oid</entry>
2539 <entry>Join selectivity estimation function for this operator</entry>
2546 Unused fields contain zeroes, for example oprleft is zero for a
2553 <sect1 id="catalog-pg-proc">
2554 <title>pg_proc</title>
2557 This catalog stores information about functions (or procedures).
2558 The description of <command>CREATE FUNCTION</command> and the
2559 <citetitle>Programmer's Guide</citetitle> contain more information
2560 about the meaning of some fields.
2564 The table contains data for aggregate functions as well as plain functions.
2565 If <structfield>proisagg</structfield> is true, there should be a matching
2566 row in <structname>pg_aggregate</structname>.
2570 <title>pg_proc Columns</title>
2577 <entry>References</entry>
2578 <entry>Description</entry>
2584 <entry>proname</entry>
2585 <entry><type>name</type></entry>
2587 <entry>Name of the function</entry>
2591 <entry>pronamespace</entry>
2592 <entry><type>oid</type></entry>
2593 <entry>pg_namespace.oid</entry>
2595 The OID of the namespace that contains this function
2600 <entry>proowner</entry>
2601 <entry><type>int4</type></entry>
2602 <entry>pg_shadow.usesysid</entry>
2603 <entry>Owner (creator) of the function</entry>
2607 <entry>prolang</entry>
2608 <entry><type>oid</type></entry>
2609 <entry>pg_language.oid</entry>
2610 <entry>Implementation language or call interface of this function</entry>
2614 <entry>proisagg</entry>
2615 <entry><type>bool</type></entry>
2617 <entry>Function is an aggregate function</entry>
2621 <entry>prosecdef</entry>
2622 <entry><type>bool</type></entry>
2624 <entry>Function is a security definer (i.e., a <quote>setuid</>
2629 <entry>proisstrict</entry>
2630 <entry><type>bool</type></entry>
2633 Function returns null if any call argument is null. In that
2634 case the function won't actually be called at all. Functions
2635 that are not <quote>strict</quote> must be prepared to handle
2641 <entry>proretset</entry>
2642 <entry><type>bool</type></entry>
2644 <entry>Function returns a set (ie, multiple values of the specified
2649 <entry>provolatile</entry>
2650 <entry><type>char</type></entry>
2653 <structfield>provolatile</structfield> tells whether the function's
2654 result depends only on its input arguments, or is affected by outside
2656 It is <literal>i</literal> for <quote>immutable</> functions,
2657 which always deliver the same result for the same inputs.
2658 It is <literal>s</literal> for <quote>stable</> functions,
2659 whose results (for fixed inputs) do not change within a scan.
2660 It is <literal>v</literal> for <quote>volatile</> functions,
2661 whose results may change at any time. (Use <literal>v</literal> also
2662 for functions with side-effects, so that calls to them cannot get
2668 <entry>pronargs</entry>
2669 <entry><type>int2</type></entry>
2671 <entry>Number of arguments</entry>
2675 <entry>prorettype</entry>
2676 <entry><type>oid</type></entry>
2677 <entry>pg_type.oid</entry>
2678 <entry>Data type of the return value</entry>
2682 <entry>proargtypes</entry>
2683 <entry><type>oidvector</type></entry>
2684 <entry>pg_type.oid</entry>
2685 <entry>A vector with the data types of the function arguments</entry>
2689 <entry>prosrc</entry>
2690 <entry><type>text</type></entry>
2693 This tells the function handler how to invoke the function. It
2694 might be the actual source code of the function for interpreted
2695 languages, a link symbol, a file name, or just about anything
2696 else, depending on the implementation language/call convention.
2701 <entry>probin</entry>
2702 <entry><type>bytea</type></entry>
2704 <entry>Additional information about how to invoke the function.
2705 Again, the interpretation is language-specific.
2710 <entry>proacl</entry>
2711 <entry><type>aclitem[]</type></entry>
2713 <entry>Access permissions</entry>
2720 Currently, prosrc contains the function's C-language name (link symbol)
2721 for compiled functions, both built-in and dynamically loaded. For all
2722 other language types, prosrc contains the function's source text.
2726 Currently, probin is unused except for dynamically-loaded C functions,
2727 for which it gives the name of the shared library file containing the
2733 <sect1 id="catalog-pg-rewrite">
2734 <title>pg_rewrite</title>
2737 This system catalog stores rewrite rules for tables and views.
2741 <title>pg_rewrite Columns</title>
2748 <entry>References</entry>
2749 <entry>Description</entry>
2755 <entry>rulename</entry>
2756 <entry><type>name</type></entry>
2758 <entry>Rule name</entry>
2762 <entry>ev_class</entry>
2763 <entry><type>oid</type></entry>
2764 <entry>pg_class.oid</entry>
2765 <entry>The table this rule is for</entry>
2769 <entry>ev_attr</entry>
2770 <entry><type>int2</type></entry>
2772 <entry>The column this rule is for (currently, always zero to
2773 indicate the whole table)</entry>
2777 <entry>ev_type</entry>
2778 <entry><type>char</type></entry>
2780 <entry>Event type that the rule is for: '1' = SELECT,
2781 '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry>
2785 <entry>is_instead</entry>
2786 <entry><type>bool</type></entry>
2788 <entry>True if the rule is an INSTEAD rule</entry>
2792 <entry>ev_qual</entry>
2793 <entry><type>text</type></entry>
2795 <entry>Expression tree (in the form of a nodeToString representation)
2796 for the rule's qualifying condition</entry>
2800 <entry>ev_action</entry>
2801 <entry><type>text</type></entry>
2803 <entry>Query tree (in the form of a nodeToString representation)
2804 for the rule's action</entry>
2812 <structname>pg_class</structname>.<structfield>relhasrules</structfield>
2813 must be true if a table has any rules in this catalog.
2820 <sect1 id="catalog-pg-shadow">
2821 <title>pg_shadow</title>
2824 <structname>pg_shadow</structname> contains information about
2825 database users. The name stems from the fact that this table
2826 should not be readable by the public since it contains passwords.
2827 <structname>pg_user</structname> is a publicly readable view on
2828 <structname>pg_shadow</structname> that blanks out the password field.
2832 The <citetitle>Administrator's Guide</citetitle> contains detailed
2833 information about user and permission management.
2837 Because user identities are cluster-wide,
2838 <structname>pg_shadow</structname>
2839 is shared across all databases of a cluster: there is only one
2840 copy of <structname>pg_shadow</structname> per cluster, not
2845 <title>pg_shadow Columns</title>
2852 <entry>References</entry>
2853 <entry>Description</entry>
2859 <entry>usename</entry>
2860 <entry><type>name</type></entry>
2862 <entry>User name</entry>
2866 <entry>usesysid</entry>
2867 <entry><type>int4</type></entry>
2869 <entry>User id (arbitrary number used to reference this user)</entry>
2873 <entry>usecreatedb</entry>
2874 <entry><type>bool</type></entry>
2876 <entry>User may create databases</entry>
2880 <entry>usesuper</entry>
2881 <entry><type>bool</type></entry>
2883 <entry>User is a superuser</entry>
2887 <entry>usecatupd</entry>
2888 <entry><type>bool</type></entry>
2891 User may update system catalogs. (Even a superuser may not do
2892 this unless this attribute is true.)
2897 <entry>passwd</entry>
2898 <entry><type>text</type></entry>
2900 <entry>Password</entry>
2904 <entry>valuntil</entry>
2905 <entry><type>abstime</type></entry>
2907 <entry>Account expiry time (only used for password authentication)</entry>
2911 <entry>useconfig</entry>
2912 <entry><type>text[]</type></entry>
2914 <entry>Session defaults for run-time configuration variables</entry>
2923 <sect1 id="catalog-pg-statistic">
2924 <title>pg_statistic</title>
2927 <structname>pg_statistic</structname> stores statistical data about
2928 the contents of the database. Entries are created by
2929 <command>ANALYZE</command> and subsequently used by the query planner.
2930 There is one entry for each table column that has been analyzed.
2931 Note that all the statistical data is inherently approximate,
2932 even assuming that it is up-to-date.
2936 Since different kinds of statistics may be appropriate for different
2937 kinds of data, <structname>pg_statistic</structname> is designed not
2938 to assume very much about what sort of statistics it stores. Only
2939 extremely general statistics (such as NULL-ness) are given dedicated
2940 columns in <structname>pg_statistic</structname>. Everything else
2941 is stored in <quote>slots</quote>, which are groups of associated columns whose
2942 content is identified by a code number in one of the slot's columns.
2943 For more information see
2944 <filename>src/include/catalog/pg_statistic.h</filename>.
2948 <structname>pg_statistic</structname> should not be readable by the
2949 public, since even statistical information about a table's contents
2950 may be considered sensitive. (Example: minimum and maximum values
2951 of a salary column might be quite interesting.)
2952 <structname>pg_stats</structname> is a publicly readable view on
2953 <structname>pg_statistic</structname> that only exposes information
2954 about those tables that are readable by the current user.
2955 <structname>pg_stats</structname> is also designed to present the
2956 information in a more readable format than the underlying
2957 <structname>pg_statistic</structname> table --- at the cost that
2958 its schema must be extended whenever new slot types are added.
2962 <title>pg_statistic Columns</title>
2969 <entry>References</entry>
2970 <entry>Description</entry>
2976 <entry>starelid</entry>
2977 <entry><type>oid</type></entry>
2978 <entry>pg_class.oid</entry>
2979 <entry>The table that the described column belongs to</entry>
2983 <entry>staattnum</entry>
2984 <entry><type>int2</type></entry>
2985 <entry>pg_attribute.attnum</entry>
2986 <entry>The number of the described column</entry>
2990 <entry>stanullfrac</entry>
2991 <entry><type>float4</type></entry>
2993 <entry>The fraction of the column's entries that are NULL</entry>
2997 <entry>stawidth</entry>
2998 <entry><type>int4</type></entry>
3000 <entry>The average stored width, in bytes, of non-NULL entries</entry>
3004 <entry>stadistinct</entry>
3005 <entry><type>float4</type></entry>
3007 <entry>The number of distinct non-NULL data values in the column.
3008 A value greater than zero is the actual number of distinct values.
3009 A value less than zero is the negative of a fraction of the number
3010 of rows in the table (for example, a column in which values appear about
3011 twice on the average could be represented by stadistinct = -0.5).
3012 A zero value means the number of distinct values is unknown.
3017 <entry>stakindN</entry>
3018 <entry><type>int2</type></entry>
3020 <entry>A code number indicating the kind of statistics stored in the Nth
3021 <quote>slot</quote> of the <structname>pg_statistic</structname> row.
3026 <entry>staopN</entry>
3027 <entry><type>oid</type></entry>
3028 <entry>pg_operator.oid</entry>
3029 <entry>An operator used to derive the statistics stored in the
3030 Nth <quote>slot</quote>. For example, a histogram slot would show the <literal><</literal>
3031 operator that defines the sort order of the data.
3036 <entry>stanumbersN</entry>
3037 <entry><type>float4[]</type></entry>
3039 <entry>Numerical statistics of the appropriate kind for the Nth
3040 <quote>slot</quote>, or NULL if the slot kind does not involve numerical values.
3045 <entry>stavaluesN</entry>
3046 <entry><type>text[]</type></entry>
3048 <entry>Column data values of the appropriate kind for the Nth
3049 <quote>slot</quote>, or NULL if the slot kind does not store any data values.
3050 For data-type independence, all column data values are converted
3051 to external textual form and stored as TEXT datums.
3061 <sect1 id="catalog-pg-trigger">
3062 <title>pg_trigger</title>
3065 This system catalog stores triggers on tables. See under
3066 <command>CREATE TRIGGER</command> for more information.
3070 <title>pg_trigger Columns</title>
3077 <entry>References</entry>
3078 <entry>Description</entry>
3084 <entry>tgrelid</entry>
3085 <entry><type>oid</type></entry>
3086 <entry>pg_class.oid</entry>
3087 <entry>The table this trigger is on</entry>
3091 <entry>tgname</entry>
3092 <entry><type>name</type></entry>
3094 <entry>Trigger name (must be unique among triggers of same table)</entry>
3098 <entry>tgfoid</entry>
3099 <entry><type>oid</type></entry>
3100 <entry>pg_proc.oid</entry>
3101 <entry>The function to be called</entry>
3105 <entry>tgtype</entry>
3106 <entry><type>int2</type></entry>
3108 <entry>Bitmask identifying trigger conditions</entry>
3112 <entry>tgenabled</entry>
3113 <entry><type>bool</type></entry>
3115 <entry>True if trigger is enabled (not presently checked everywhere
3116 it should be, so disabling a trigger by setting this false does not
3117 work reliably)</entry>
3121 <entry>tgisconstraint</entry>
3122 <entry><type>bool</type></entry>
3124 <entry>True if trigger implements an RI constraint</entry>
3128 <entry>tgconstrname</entry>
3129 <entry><type>name</type></entry>
3131 <entry>RI constraint name</entry>
3135 <entry>tgconstrrelid</entry>
3136 <entry><type>oid</type></entry>
3137 <entry>pg_class.oid</entry>
3138 <entry>The table referenced by an RI constraint</entry>
3142 <entry>tgdeferrable</entry>
3143 <entry><type>bool</type></entry>
3145 <entry>True if deferrable</entry>
3149 <entry>tginitdeferred</entry>
3150 <entry><type>bool</type></entry>
3152 <entry>True if initially deferred</entry>
3156 <entry>tgnargs</entry>
3157 <entry><type>int2</type></entry>
3159 <entry>Number of argument strings passed to trigger function</entry>
3163 <entry>tgattr</entry>
3164 <entry><type>int2vector</type></entry>
3166 <entry>Currently unused</entry>
3170 <entry>tgargs</entry>
3171 <entry><type>bytea</type></entry>
3173 <entry>Argument strings to pass to trigger, each null-terminated</entry>
3181 <structname>pg_class</structname>.<structfield>reltriggers</structfield>
3182 needs to match up with the entries in this table.
3189 <sect1 id="catalog-pg-type">
3190 <title>pg_type</title>
3193 This catalog stores information about data types. Scalar types
3194 (<quote>base types</>) are created with <command>CREATE TYPE</command>.
3195 A complex type is automatically created for each table in the database, to
3196 represent the row structure of the table. It is also possible to create
3197 complex types with <command>CREATE TYPE AS</command>, and
3198 derived types with <command>CREATE DOMAIN</command>.
3202 <title>pg_type Columns</title>
3209 <entry>References</entry>
3210 <entry>Description</entry>
3216 <entry>typname</entry>
3217 <entry><type>name</type></entry>
3219 <entry>Data type name</entry>
3223 <entry>typnamespace</entry>
3224 <entry><type>oid</type></entry>
3225 <entry>pg_namespace.oid</entry>
3227 The OID of the namespace that contains this type
3232 <entry>typowner</entry>
3233 <entry><type>int4</type></entry>
3234 <entry>pg_shadow.usesysid</entry>
3235 <entry>Owner (creator) of the type</entry>
3239 <entry>typlen</entry>
3240 <entry><type>int2</type></entry>
3243 For a fixed-size type, <structfield>typlen</structfield> is the number
3244 of bytes in the internal representation of the type. But for a
3245 variable-length type, <structfield>typlen</structfield> is negative.
3246 -1 indicates a <quote>varlena</> type (one that has a length word),
3247 -2 indicates a null-terminated C string.
3252 <entry>typbyval</entry>
3253 <entry><type>bool</type></entry>
3256 <structfield>typbyval</structfield> determines whether internal
3257 routines pass a value of this type by value or by reference.
3258 Only <type>char</type>, <type>short</type>, and
3259 <type>int</type> equivalent items can be passed by value, so if
3260 the type is not 1, 2, or 4 bytes long,
3261 <productname>PostgreSQL</> does not have
3262 the option of passing by value and so
3263 <structfield>typbyval</structfield> had better be false.
3264 Variable-length types are always passed by reference. Note that
3265 <structfield>typbyval</structfield> can be false even if the
3266 length would allow pass-by-value; this is currently true for
3267 type <type>float4</type>, for example.
3272 <entry>typtype</entry>
3273 <entry><type>char</type></entry>
3276 <structfield>typtype</structfield> is <literal>b</literal> for
3277 a base type, <literal>c</literal> for a complex type (i.e.,
3278 a table's row type), <literal>d</literal> for a derived type (i.e.,
3279 a domain), or <literal>p</literal> for a pseudo-type. See also
3280 <structfield>typrelid</structfield>
3281 and <structfield>typbasetype</structfield>.
3286 <entry>typisdefined</entry>
3287 <entry><type>bool</type></entry>
3289 <entry>True if the type is defined, false if this is a placeholder
3290 entry for a not-yet-defined type. When typisdefined is false,
3291 nothing except the type name, namespace, and OID can be relied on.
3296 <entry>typdelim</entry>
3297 <entry><type>char</type></entry>
3299 <entry>Character that separates two values of this type when parsing
3300 array input. Note that the delimiter is associated with the array
3301 element data type, not the array data type.</entry>
3305 <entry>typrelid</entry>
3306 <entry><type>oid</type></entry>
3307 <entry>pg_class.oid</entry>
3309 If this is a complex type (see
3310 <structfield>typtype</structfield>), then this field points to
3311 the <structname>pg_class</structname> entry that defines the
3312 corresponding table. (For a free-standing composite type, the
3313 <structname>pg_class</structname> entry doesn't really represent
3314 a table, but it is needed anyway for the type's
3315 <structname>pg_attribute</structname> entries to link to.)
3316 Zero for non-complex types.
3321 <entry>typelem</entry>
3322 <entry><type>oid</type></entry>
3323 <entry>pg_type.oid</entry>
3325 If <structfield>typelem</structfield> is not 0 then it
3326 identifies another row in <structname>pg_type</structname>.
3327 The current type can then be subscripted like an array yielding
3328 values of type <structfield>typelem</structfield>. A
3329 <quote>true</quote> array type is variable length
3330 (<structfield>typlen</structfield> = -1),
3331 but some fixed-length (<structfield>typlen</structfield> > 0) types
3332 also have nonzero <structfield>typelem</structfield>, for example
3333 <type>name</type> and <type>oidvector</type>.
3334 If a fixed-length type has a <structfield>typelem</structfield> then
3335 its internal representation must be N values of the
3336 <structfield>typelem</structfield> data type with no other data.
3337 Variable-length array types have a header defined by the array
3343 <entry>typinput</entry>
3344 <entry><type>regproc</type></entry>
3345 <entry>pg_proc.oid</entry>
3346 <entry>Input conversion function</entry>
3350 <entry>typoutput</entry>
3351 <entry><type>regproc</type></entry>
3352 <entry>pg_proc.oid</entry>
3353 <entry>Output conversion function</entry>
3357 <entry>typalign</entry>
3358 <entry><type>char</type></entry>
3362 <structfield>typalign</structfield> is the alignment required
3363 when storing a value of this type. It applies to storage on
3364 disk as well as most representations of the value inside
3365 <productname>PostgreSQL</>.
3366 When multiple values are stored consecutively, such
3367 as in the representation of a complete row on disk, padding is
3368 inserted before a datum of this type so that it begins on the
3369 specified boundary. The alignment reference is the beginning
3370 of the first datum in the sequence.
3372 Possible values are:
3375 <para>'c' = CHAR alignment, i.e., no alignment needed.</para>
3378 <para>'s' = SHORT alignment (2 bytes on most machines).</para>
3381 <para>'i' = INT alignment (4 bytes on most machines).</para>
3384 <para>'d' = DOUBLE alignment (8 bytes on many machines, but by no means all).</para>
3389 For types used in system tables, it is critical that the size
3390 and alignment defined in <structname>pg_type</structname>
3391 agree with the way that the compiler will lay out the field in
3392 a struct representing a table row.
3398 <entry>typstorage</entry>
3399 <entry><type>char</type></entry>
3402 <structfield>typstorage</structfield> tells for varlena
3403 types (those with <structfield>typlen</structfield> = -1) if
3404 the type is prepared for toasting and what the default strategy
3405 for attributes of this type should be.
3409 <para>'p': Value must always be stored plain.</para>
3413 'e': Value can be stored in a <quote>secondary</quote>
3414 relation (if relation has one, see
3415 <structname>pg_class</structname>.<structfield>reltoastrelid</structfield>).
3419 <para>'m': Value can be stored compressed inline.</para>
3422 <para>'x': Value can be stored compressed inline or in <quote>secondary</quote>.</para>
3425 Note that 'm' fields can also be moved out to secondary
3426 storage, but only as a last resort ('e' and 'x' fields are
3432 <entry>typnotnull</entry>
3433 <entry><type>bool</type></entry>
3436 <structfield>typnotnull</structfield> represents a NOT NULL
3437 constraint on a type. Presently used for domains only.
3442 <entry>typbasetype</entry>
3443 <entry><type>oid</type></entry>
3444 <entry>pg_type.oid</entry>
3446 If this is a derived type (see <structfield>typtype</structfield>),
3447 then <structfield>typbasetype</structfield> identifies
3448 the type that this one is based on. Zero if not a derived type.
3453 <entry>typtypmod</entry>
3454 <entry><type>int4</type></entry>
3457 Domains use <structfield>typtypmod</structfield> to record the typmod
3458 to be applied to their base type (-1 if base type does not use a
3459 typmod). -1 if this type is not a domain.
3464 <entry>typndims</entry>
3465 <entry><type>int4</type></entry>
3468 <structfield>typndims</structfield> is the number of array dimensions
3469 for a domain that is an array (that is, typbasetype is an array type;
3470 the domain's typelem will match the base type's typelem).
3471 Zero for non-domains and non-array domains.
3476 <entry>typdefaultbin</entry>
3477 <entry><type>text</type></entry>
3480 If <structfield>typdefaultbin</> is not NULL, it is the nodeToString
3481 representation of a default expression for the type. Currently this is
3482 only used for domains.
3487 <entry>typdefault</entry>
3488 <entry><type>text</type></entry>
3491 <structfield>typdefault</> is NULL if the type has no associated
3492 default value. If <structfield>typdefaultbin</> is not NULL,
3493 <structfield>typdefault</> must contain a human-readable version of the
3494 default expression represented by <structfield>typdefaultbin</>. If
3495 <structfield>typdefaultbin</> is NULL and <structfield>typdefault</> is
3496 not, then <structfield>typdefault</> is the external representation of
3497 the type's default value, which may be fed to the type's input
3498 converter to produce a constant.
3507 <!-- Keep this comment at the end of the file
3512 sgml-minimize-attributes:nil
3513 sgml-always-quote-attributes:t
3515 sgml-indent-tabs-mode:nil
3517 sgml-parent-document:nil
3518 sgml-default-dtd-file:"./reference.ced"
3519 sgml-exposed-tags:nil
3520 sgml-local-catalogs:("/usr/share/sgml/catalog")
3521 sgml-local-ecat-files:nil