2 Documentation of the system catalogs, directed toward PostgreSQL developers
3 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.29 2001/11/21 05:53:40 thomas 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 esoteric operations, such as adding index access methods.
28 <title>System Catalogs</title>
33 <entry>Catalog Name</entry>
34 <entry>Purpose</entry>
40 <entry>pg_aggregate</entry>
41 <entry>aggregate functions</entry>
46 <entry>index access methods</entry>
50 <entry>pg_amop</entry>
51 <entry>access method operators</entry>
55 <entry>pg_amproc</entry>
56 <entry>access method support procedures</entry>
60 <entry>pg_attrdef</entry>
61 <entry>column default values</entry>
65 <entry>pg_attribute</entry>
66 <entry>table columns (<quote>attributes</quote>, <quote>fields</quote>)</entry>
70 <entry>pg_class</entry>
71 <entry>tables, indexes, sequences (<quote>relations</quote>)</entry>
75 <entry>pg_database</entry>
76 <entry>databases within this database cluster</entry>
80 <entry>pg_description</entry>
81 <entry>descriptions or comments on database objects</entry>
85 <entry>pg_group</entry>
86 <entry>groups of database users</entry>
90 <entry>pg_index</entry>
91 <entry>additional index information</entry>
95 <entry>pg_inherits</entry>
96 <entry>table inheritance hierarchy</entry>
100 <entry>pg_language</entry>
101 <entry>languages for writing functions</entry>
105 <entry>pg_largeobject</entry>
106 <entry>large objects</entry>
110 <entry>pg_listener</entry>
111 <entry>asynchronous notification</entry>
115 <entry>pg_opclass</entry>
116 <entry>index access method operator classes</entry>
120 <entry>pg_operator</entry>
121 <entry>operators</entry>
125 <entry>pg_proc</entry>
126 <entry>functions and procedures</entry>
130 <entry>pg_relcheck</entry>
131 <entry>check constraints</entry>
135 <entry>pg_rewrite</entry>
136 <entry>query rewriter rules</entry>
140 <entry>pg_shadow</entry>
141 <entry>database users</entry>
145 <entry>pg_statistic</entry>
146 <entry>optimizer statistics</entry>
150 <entry>pg_trigger</entry>
151 <entry>triggers</entry>
155 <entry>pg_type</entry>
156 <entry>data types</entry>
163 More detailed documentation of most catalogs follow below. The
164 catalogs that relate to index access methods are explained in the
165 <citetitle>Programmer's Guide</citetitle>.
171 <sect1 id="catalog-pg-aggregate">
172 <title>pg_aggregate</title>
175 <structname>pg_aggregate</structname> stores information about
176 aggregate functions. An aggregate function is a function that
177 operates on a set of values (typically one column from each row
178 that matches a query condition) and returns a single value computed
179 from all these values. Typical aggregate functions are
180 <function>sum</function>, <function>count</function>, and
181 <function>max</function>.
185 <title>pg_aggregate Columns</title>
192 <entry>References</entry>
193 <entry>Description</entry>
198 <entry>aggname</entry>
199 <entry><type>name</type></entry>
201 <entry>Name of the aggregate function</entry>
204 <entry>aggowner</entry>
205 <entry><type>int4</type></entry>
206 <entry>pg_shadow.usesysid</entry>
207 <entry>Owner (creator) of the aggregate function</entry>
210 <entry>aggtransfn</entry>
211 <entry><type>regproc</type> (function)</entry>
212 <entry>pg_proc.oid</entry>
213 <entry>Transition function</entry>
216 <entry>aggfinalfn</entry>
217 <entry><type>regproc</type> (function)</entry>
218 <entry>pg_proc.oid</entry>
219 <entry>Final function</entry>
222 <entry>aggbasetype</entry>
223 <entry><type>oid</type></entry>
224 <entry>pg_type.oid</entry>
225 <entry>The input datatype for this aggregate function</entry>
228 <entry>aggtranstype</entry>
229 <entry><type>oid</type></entry>
230 <entry>pg_type.oid</entry>
231 <entry>The type of the aggregate function's internal transition (state) data</entry>
234 <entry>aggfinaltype</entry>
235 <entry><type>oid</type></entry>
236 <entry>pg_type.oid</entry>
237 <entry>The type of the result</entry>
240 <entry>agginitval</entry>
241 <entry><type>text</type></entry>
244 The initial value of the transition state. This is a text
245 field containing the initial value in its external string
246 representation. If the field is NULL, the transition state
247 value starts out NULL.
255 New aggregate functions are registered with the <command>CREATE
256 AGGREGATE</command> command. See the <citetitle>Programmer's
257 Guide</citetitle> for more information about writing aggregate
258 functions and the meaning of the transition functions, etc.
262 An aggregate function is identified through name
263 <emphasis>and</emphasis> argument type. Hence aggname and aggbasetype
264 are the composite primary key.
270 <sect1 id="catalog-pg-attrdef">
271 <title>pg_attrdef</title>
274 This catalog stores column default values. The main information
275 about columns is stored in <structname>pg_attribute</structname>
276 (see below). Only columns that explicitly specify a default value
277 (when the table is created or the column is added) will have an
282 <title>pg_attrdef Columns</title>
289 <entry>References</entry>
290 <entry>Description</entry>
296 <entry>adrelid</entry>
297 <entry><type>oid</type></entry>
298 <entry>pg_class.oid</entry>
299 <entry>The table this column belongs to</entry>
304 <entry><type>int2</type></entry>
305 <entry>pg_attribute.attnum</entry>
306 <entry>The number of the column</entry>
311 <entry><type>text</type></entry>
313 <entry>An internal representation of the column default value</entry>
318 <entry><type>text</type></entry>
320 <entry>A human-readable representation of the default value</entry>
329 <sect1 id="catalog-pg-attribute">
330 <title>pg_attribute</title>
333 <structname>pg_attribute</structname> stores information about
334 table columns. There will be exactly one
335 <structname>pg_attribute</structname> row for every column in every
336 table in the database. (There will also be attribute entries for
337 indexes and other objects. See <structname>pg_class</structname>.)
341 The term attribute is equivalent to column and is used for
346 <title>pg_attribute Columns</title>
353 <entry>References</entry>
354 <entry>Description</entry>
360 <entry>attrelid</entry>
361 <entry><type>oid</type></entry>
362 <entry>pg_class.oid</entry>
363 <entry>The table this column belongs to</entry>
367 <entry>attname</entry>
368 <entry><type>name</type></entry>
370 <entry>Column name</entry>
374 <entry>atttypid</entry>
375 <entry><type>oid</type></entry>
376 <entry>pg_type.oid</entry>
377 <entry>The data type of this column</entry>
381 <entry>attstattarget</entry>
382 <entry><type>int4</type></entry>
385 <structfield>attstattarget</structfield> controls the level of detail
386 of statistics accumulated for this column by
387 <command>ANALYZE</command>.
388 A zero value indicates that no statistics should be collected.
389 The exact meaning of positive values is datatype-dependent.
390 For scalar datatypes, <structfield>attstattarget</structfield>
391 is both the target number of <quote>most common values</quote>
392 to collect, and the target number of histogram bins to create.
397 <entry>attlen</entry>
398 <entry><type>int2</type></entry>
401 This is a copy of the
402 <structname>pg_type</structname>.<structfield>typlen</structfield>
403 for this column's type.
408 <entry>attnum</entry>
409 <entry><type>int2</type></entry>
412 The number of the column. Ordinary columns are numbered from 1
413 up. System columns, such as <structfield>oid</structfield>,
414 have (arbitrary) negative numbers.
419 <entry>attndims</entry>
420 <entry><type>int4</type></entry>
423 Number of dimensions, if the column is an array type; otherwise 0.
424 (Presently, the number of dimensions of an array is not enforced,
425 so any nonzero value effectively means <quote>it's an array</>.)
430 <entry>attcacheoff</entry>
431 <entry><type>int4</type></entry>
434 Always -1 in storage, but when loaded into a tuple descriptor
435 in memory this may be updated to cache the offset of the attribute
441 <entry>atttypmod</entry>
442 <entry><type>int4</type></entry>
445 <structfield>atttypmod</structfield> records type-specific data
446 supplied at table creation time (for example, the maximum
447 length of a <type>varchar</type> column). It is passed to
448 type-specific input and output functions as the third
449 argument. The value will generally be -1 for types that do not
455 <entry>attbyval</entry>
456 <entry><type>bool</type></entry>
460 <structname>pg_type</structname>.<structfield>typbyval</structfield>
461 of this column's type
466 <entry>attstorage</entry>
467 <entry><type>char</type></entry>
471 <structname>pg_type</structname>.<structfield>typstorage</structfield>
472 of this column's type
477 <entry>attisset</entry>
478 <entry><type>bool</type></entry>
481 If true, this attribute is a set. In that case, what is really
482 stored in the attribute is the OID of a tuple in the
483 <structname>pg_proc</structname> catalog. The
484 <structname>pg_proc</structname> tuple contains the query
485 string that defines this set - i.e., the query to run to get
486 the set. So the <structfield>atttypid</structfield> (see
487 above) refers to the type returned by this query, but the
488 actual length of this attribute is the length (size) of an
489 <type>oid</type>. --- At least this is the theory. All this
490 is probably quite broken these days.
495 <entry>attalign</entry>
496 <entry><type>char</type></entry>
500 <structname>pg_type</structname>.<structfield>typalign</structfield>
501 of this column's type
506 <entry>attnotnull</entry>
507 <entry><type>bool</type></entry>
510 This represents a NOT NULL constraint. It is possible to
511 change this field to enable or disable the constraint.
516 <entry>atthasdef</entry>
517 <entry><type>bool</type></entry>
520 This column has a default value, in which case there will be a
521 corresponding entry in the <structname>pg_attrdef</structname>
522 catalog that actually defines the value.
532 <sect1 id="catalog-pg-class">
533 <title>pg_class</title>
536 <structname>pg_class</structname> catalogues tables and mostly
537 everything else that has columns or is otherwise similar to a
538 table. This includes indexes (but see also
539 <structname>pg_index</structname>), sequences, views, and some
540 kinds of special relation. Below, when we mean all of these
541 kinds of objects we speak of <quote>relations</quote>. Not all
542 fields are meaningful for all relation types.
546 <title>pg_class Columns</title>
553 <entry>References</entry>
554 <entry>Description</entry>
560 <entry>relname</entry>
561 <entry><type>name</type></entry>
563 <entry>Name of the table, index, view, etc.</entry>
567 <entry>reltype</entry>
568 <entry><type>oid</type></entry>
569 <entry>pg_type.oid</entry>
571 The OID of the data type that corresponds to this table, if any
572 (zero for indexes, which have no pg_type entry)
577 <entry>relowner</entry>
578 <entry><type>int4</type></entry>
579 <entry>pg_shadow.usesysid</entry>
580 <entry>Owner of the relation</entry>
585 <entry><type>oid</type></entry>
586 <entry>pg_am.oid</entry>
587 <entry>If this is an index, the access method used (btree, hash, etc.)</entry>
591 <entry>relfilenode</entry>
592 <entry><type>oid</type></entry>
594 <entry>Name of the on-disk file of this relation</entry>
598 <entry>relpages</entry>
599 <entry><type>int4</type></entry>
602 Size of the on-disk representation of this table in pages (size
603 <symbol>BLCKSZ</symbol>).
604 This is only an estimate used by the planner.
605 It is updated by <command>VACUUM</command>,
606 <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
611 <entry>reltuples</entry>
612 <entry><type>float4</type></entry>
615 Number of tuples in the table.
616 This is only an estimate used by the planner.
617 It is updated by <command>VACUUM</command>,
618 <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
623 <entry>reltoastrelid</entry>
624 <entry><type>oid</type></entry>
625 <entry>pg_class.oid</entry>
627 Oid of the TOAST table associated with this table, 0 if none.
628 The TOAST table stores large attributes <quote>out of
629 line</quote> in a secondary table.
634 <entry>reltoastidxid</entry>
635 <entry><type>oid</type></entry>
636 <entry>pg_class.oid</entry>
638 For a TOAST table, the OID of its index. 0 if not a TOAST table.
643 <entry>relhasindex</entry>
644 <entry><type>bool</type></entry>
646 <entry>True if this is a table and it has (or recently had) any indexes.
647 This is set by CREATE INDEX, but not cleared immediately by DROP INDEX.
648 VACUUM clears relhasindex if it finds the table has no indexes.
653 <entry>relisshared</entry>
654 <entry><type>bool</type></entry>
656 <entry>True if this table is shared across all databases in the
657 cluster. Only certain system catalogs (such as
658 <structname>pg_database</structname>) are shared.</entry>
662 <entry>relkind</entry>
663 <entry><type>char</type></entry>
666 'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
667 's' = special, 't' = secondary TOAST table
672 <entry>relnatts</entry>
673 <entry><type>int2</type></entry>
676 Number of user columns in the relation (system columns not counted).
677 There must be this many corresponding entries in
678 <structname>pg_attribute</structname>. See also
679 <structname>pg_attribute</structname>.<structfield>attnum</structfield>.
684 <entry>relchecks</entry>
685 <entry><type>int2</type></entry>
688 Number of check constraints on the table; see
689 <structname>pg_relcheck</structname> catalog
694 <entry>reltriggers</entry>
695 <entry><type>int2</type></entry>
698 Number of triggers on the table; see
699 <structname>pg_trigger</structname> catalog
704 <entry>relukeys</entry>
705 <entry><type>int2</type></entry>
707 <entry>unused (<emphasis>Not</emphasis> the number of unique keys)</entry>
711 <entry>relfkeys</entry>
712 <entry><type>int2</type></entry>
714 <entry>unused (<emphasis>Not</emphasis> the number of foreign keys on the table)</entry>
718 <entry>relrefs</entry>
719 <entry><type>int2</type></entry>
721 <entry>unused</entry>
725 <entry>relhasoids</entry>
726 <entry><type>bool</type></entry>
729 True if we generate an OID for each row of the relation.
734 <entry>relhaspkey</entry>
735 <entry><type>bool</type></entry>
738 True if the table has (or once had) a primary key.
743 <entry>relhasrules</entry>
744 <entry><type>bool</type></entry>
746 <entry>Table has rules; see
747 <structname>pg_rewrite</structname> catalog
752 <entry>relhassubclass</entry>
753 <entry><type>bool</type></entry>
755 <entry>At least one table inherits from this one</entry>
759 <entry>relacl</entry>
760 <entry><type>aclitem[]</type></entry>
763 Access permissions. See the descriptions of
764 <command>GRANT</command> and <command>REVOKE</command> for
774 <sect1 id="catalog-pg-database">
775 <title>pg_database</title>
778 The <structname>pg_database</structname> catalog stores information
779 about the available databases. Databases are created with the
780 <command>CREATE DATABASE</command> command. Consult the
781 <citetitle>Administrator's Guide</citetitle> for details about the
782 meaning of some of the parameters.
786 Unlike most system catalogs, <structname>pg_database</structname>
787 is shared across all databases of a cluster: there is only one
788 copy of <structname>pg_database</structname> per cluster, not
793 <title>pg_database Columns</title>
800 <entry>References</entry>
801 <entry>Description</entry>
807 <entry>datname</entry>
808 <entry><type>name</type></entry>
810 <entry>Database name</entry>
814 <entry>datdba</entry>
815 <entry><type>int4</type></entry>
816 <entry>pg_shadow.usesysid</entry>
817 <entry>Owner of the database, initially who created it</entry>
821 <entry>encoding</entry>
822 <entry><type>int4</type></entry>
824 <entry>Character/multibyte encoding for this database</entry>
828 <entry>datistemplate</entry>
829 <entry><type>bool</type></entry>
832 If true then this database can be used in the
833 <quote>TEMPLATE</quote> clause of <command>CREATE
834 DATABASE</command> to create the new database as a clone of
840 <entry>datallowconn</entry>
841 <entry><type>bool</type></entry>
844 If false then no one can connect to this database. This is
845 used to protect the template0 database from being altered.
850 <entry>datlastsysoid</entry>
851 <entry><type>oid</type></entry>
854 Last system OID in the database; useful
855 particularly to <application>pg_dump</application>
860 <entry>datvacuumxid</entry>
861 <entry><type>xid</type></entry>
864 All tuples inserted or deleted by transaction IDs before this one
865 have been marked as known committed or known aborted in this database.
866 This is used to determine when commit-log space can be recycled.
871 <entry>datfrozenxid</entry>
872 <entry><type>xid</type></entry>
875 All tuples inserted by transaction IDs before this one have been
876 relabeled with a permanent (<quote>frozen</>) transaction ID in this
877 database. This is useful to check whether a database must be vacuumed
878 soon to avoid transaction ID wraparound problems.
883 <entry>datpath</entry>
884 <entry><type>text</type></entry>
887 If the database is stored at an alternative location then this
888 records the location. It's either an environment variable name
889 or an absolute path, depending how it was entered.
898 <sect1 id="catalog-pg-description">
899 <title>pg_description</title>
902 The pg_description table can store an optional description or
903 comment for each database object. Descriptions can be manipulated
904 with the <command>COMMENT</command> command. Client applications
905 can view the descriptions by joining with this table. Many builtin
906 system objects have comments associated with them that are shown by
907 <application>psql</application>'s <literal>\d</literal> commands.
911 <title>pg_description Columns</title>
918 <entry>References</entry>
919 <entry>Description</entry>
925 <entry>objoid</entry>
926 <entry><type>oid</type></entry>
927 <entry>any oid attribute</entry>
928 <entry>The oid of the object this description pertains to</entry>
932 <entry>classoid</entry>
933 <entry><type>oid</type></entry>
934 <entry>pg_class.oid</entry>
935 <entry>The oid of the system catalog this object appears in</entry>
939 <entry>objsubid</entry>
940 <entry><type>int4</type></entry>
942 <entry>For a comment on a table attribute, this is the attribute's
943 column number (the objoid and classoid refer to the table itself).
944 For all other object types, this field is presently zero.
949 <entry>description</entry>
950 <entry><type>text</type></entry>
952 <entry>Arbitrary text that serves as the description of this object.</entry>
961 <sect1 id="catalog-pg-group">
962 <title>pg_group</title>
965 This catalog defines groups and stores what users belong to what
966 groups. Groups are created with the <command>CREATE
967 GROUP</command> command. Consult the <citetitle>Administrator's
968 Guide</citetitle> for information about user permission management.
972 Because user and group identities are cluster-wide,
973 <structname>pg_group</structname>
974 is shared across all databases of a cluster: there is only one
975 copy of <structname>pg_group</structname> per cluster, not
980 <title>pg_group Columns</title>
987 <entry>References</entry>
988 <entry>Description</entry>
994 <entry>groname</entry>
995 <entry><type>name</type></entry>
997 <entry>Name of the group</entry>
1001 <entry>grosysid</entry>
1002 <entry><type>int4</type></entry>
1004 <entry>An arbitrary number to identify this group</entry>
1008 <entry>grolist</entry>
1009 <entry><type>int4[]</type></entry>
1010 <entry>pg_shadow.usesysid</entry>
1011 <entry>An array containing the ids of the users in this group</entry>
1020 <sect1 id="catalog-pg-index">
1021 <title>pg_index</title>
1024 <structname>pg_index</structname> contains part of the information
1025 about indexes. The rest is mostly in
1026 <structname>pg_class</structname>.
1030 <title>pg_index Columns</title>
1037 <entry>References</entry>
1038 <entry>Description</entry>
1044 <entry>indexrelid</entry>
1045 <entry><type>oid</type></entry>
1046 <entry>pg_class.oid</entry>
1047 <entry>The oid of the pg_class entry for this index</entry>
1051 <entry>indrelid</entry>
1052 <entry><type>oid</type></entry>
1053 <entry>pg_class.oid</entry>
1054 <entry>The oid of the pg_class entry for the table this index is for</entry>
1058 <entry>indproc</entry>
1059 <entry><type>regproc</type></entry>
1060 <entry>pg_proc.oid</entry>
1061 <entry>The registered procedure if this is a functional index</entry>
1065 <entry>indkey</entry>
1066 <entry><type>int2vector</type></entry>
1067 <entry>pg_attribute.attnum</entry>
1069 This is a vector (array) of up to
1070 <symbol>INDEX_MAX_KEYS</symbol> values that indicate which
1071 table columns this index pertains to. For example a value of
1072 <literal>1 3</literal> would mean that the first and the third
1073 column make up the index key.
1078 <entry>indclass</entry>
1079 <entry><type>oidvector</type></entry>
1080 <entry>pg_opclass.oid</entry>
1082 For each column in the index key this contains a reference to
1083 the <quote>operator class</quote> to use. See
1084 <structname>pg_opclass</structname> for details.
1089 <entry>indisclustered</entry>
1090 <entry><type>bool</type></entry>
1092 <entry>unused</entry>
1096 <entry>indisunique</entry>
1097 <entry><type>bool</type></entry>
1099 <entry>If true, this is a unique index.</entry>
1103 <entry>indisprimary</entry>
1104 <entry><type>bool</type></entry>
1106 <entry>If true, this index represents the primary key of the table.
1107 (indisunique should always be true when this is true.)</entry>
1111 <entry>indreference</entry>
1112 <entry><type>oid</type></entry>
1114 <entry>unused</entry>
1118 <entry>indpred</entry>
1119 <entry><type>text</type></entry>
1121 <entry>Expression tree (in the form of a nodeToString representation)
1122 for partial index predicate</entry>
1131 <sect1 id="catalog-pg-inherits">
1132 <title>pg_inherits</title>
1135 This catalog records information about table inheritance hierarchies.
1139 <title>pg_inherits Columns</title>
1146 <entry>References</entry>
1147 <entry>Description</entry>
1153 <entry>inhrelid</entry>
1154 <entry><type>oid</type></entry>
1155 <entry>pg_class.oid</entry>
1157 This is the reference to the subtable, that is, it records the
1158 fact that the identified table is inherited from some other
1164 <entry>inhparent</entry>
1165 <entry><type>oid</type></entry>
1166 <entry>pg_class.oid</entry>
1168 This is the reference to the parent table, which the table
1169 referenced by <structfield>inhrelid</structfield> inherited
1175 <entry>inhseqno</entry>
1176 <entry><type>int4</type></entry>
1179 If there is more than one parent for a subtable (multiple
1180 inheritance), this number tells the order in which the
1181 inherited columns are to be arranged. The count starts at 1.
1191 <sect1 id="catalog-pg-language">
1192 <title>pg_language</title>
1195 <structname>pg_language</structname> registers call interfaces or
1196 languages in which you can write functions or stored procedures.
1197 See under <command>CREATE LANGUAGE</command> and in the
1198 <citetitle>Programmer's Guide</citetitle> for more information
1199 about language handlers.
1203 <title>pg_language Columns</title>
1210 <entry>References</entry>
1211 <entry>Description</entry>
1217 <entry>lanname</entry>
1218 <entry><type>name</type></entry>
1220 <entry>Name of the language (to be specified when creating a function)</entry>
1224 <entry>lanispl</entry>
1225 <entry><type>bool</type></entry>
1228 This is false for internal languages (such as SQL) and true for
1229 dynamically loaded language handler modules. It essentially
1230 means that, if it is true, the language may be dropped.
1235 <entry>lanpltrusted</entry>
1236 <entry><type>bool</type></entry>
1239 This is a trusted language. See under <command>CREATE
1240 LANGUAGE</command> what this means. If this is an internal
1241 language (<structfield>lanispl</structfield> is false) then
1242 this field is meaningless.
1247 <entry>lanplcallfoid</entry>
1248 <entry><type>oid</type></entry>
1249 <entry>pg_proc.oid</entry>
1251 For non-internal languages this references the language
1252 handler, which is a special function that is responsible for
1253 executing all functions that are written in the particular
1259 <entry>lancompiler</entry>
1260 <entry><type>text</type></entry>
1262 <entry>not currently used</entry>
1271 <sect1 id="catalog-pg-largeobject">
1272 <title>pg_largeobject</title>
1275 <structname>pg_largeobject</structname> holds the data making up
1276 <quote>large objects</quote>. A large object is identified by an
1277 OID assigned when it is created. Each large object is broken into
1278 segments or <quote>pages</> small enough to be conveniently stored as rows
1279 in <structname>pg_largeobject</structname>.
1280 The amount of data per page is defined to be LOBLKSIZE (which is currently
1281 BLCKSZ/4, or typically 2Kbytes).
1285 <title>pg_largeobject Columns</title>
1292 <entry>References</entry>
1293 <entry>Description</entry>
1300 <entry><type>oid</type></entry>
1302 <entry>Identifier of the large object that includes this page</entry>
1306 <entry>pageno</entry>
1307 <entry><type>int4</type></entry>
1309 <entry>Page number of this page within its large object
1310 (counting from zero)</entry>
1315 <entry><type>bytea</type></entry>
1318 Actual data stored in the large object.
1319 This will never be more than LOBLKSIZE bytes, and may be less.
1327 Each row of <structname>pg_largeobject</structname> holds data
1328 for one page of a large object, beginning at
1329 byte offset (pageno * LOBLKSIZE) within the object. The implementation
1330 allows sparse storage: pages may be missing, and may be shorter than
1331 LOBLKSIZE bytes even if they are not the last page of the object.
1332 Missing regions within a large object read as zeroes.
1338 <sect1 id="catalog-pg-listener">
1339 <title>pg_listener</title>
1342 <structname>pg_listener</structname> supports the <command>LISTEN</>
1343 and <command>NOTIFY</> commands. A listener creates an entry in
1344 <structname>pg_listener</structname> for each notification name
1345 it is listening for. A notifier scans <structname>pg_listener</structname>
1346 and updates each matching entry to show that a notification has occurred.
1347 The notifier also sends a signal (using the PID recorded in the table)
1348 to awaken the listener from sleep.
1352 <title>pg_listener Columns</title>
1359 <entry>References</entry>
1360 <entry>Description</entry>
1366 <entry>relname</entry>
1367 <entry><type>name</type></entry>
1369 <entry>Notify condition name. (The name need not match any actual
1370 relation in the database; the term <quote>relname</> is historical.)
1375 <entry>listenerpid</entry>
1376 <entry><type>int4</type></entry>
1378 <entry>PID of the backend process that created this entry.</entry>
1382 <entry>notification</entry>
1383 <entry><type>int4</type></entry>
1386 Zero if no event is pending for this listener. If an event is
1387 pending, the PID of the backend that sent the notification.
1397 <sect1 id="catalog-pg-operator">
1398 <title>pg_operator</title>
1401 See <command>CREATE OPERATOR</command> and the
1402 <citetitle>Programmer's Guide</citetitle> for details on these
1403 operator parameters.
1407 <title>pg_operator Columns</title>
1414 <entry>References</entry>
1415 <entry>Description</entry>
1421 <entry>oprname</entry>
1422 <entry><type>name</type></entry>
1424 <entry>Name of the operator</entry>
1428 <entry>oprowner</entry>
1429 <entry><type>int4</type></entry>
1430 <entry>pg_shadow.usesysid</entry>
1431 <entry>Owner (creator) of the operator</entry>
1435 <entry>oprprec</entry>
1436 <entry><type>int2</type></entry>
1438 <entry>unused</entry>
1442 <entry>oprkind</entry>
1443 <entry><type>char</type></entry>
1446 'b' = infix (<quote>both</quote>), 'l' = prefix
1447 (<quote>left</quote>), 'r' = postfix (<quote>right</quote>)
1452 <entry>oprisleft</entry>
1453 <entry><type>bool</type></entry>
1455 <entry>unused</entry>
1459 <entry>oprcanhash</entry>
1460 <entry><type>bool</type></entry>
1462 <entry>This operator supports hash joins.</entry>
1466 <entry>oprleft</entry>
1467 <entry><type>oid</type></entry>
1468 <entry>pg_type.oid</entry>
1469 <entry>Type of the left operand</entry>
1473 <entry>oprright</entry>
1474 <entry><type>oid</type></entry>
1475 <entry>pg_type.oid</entry>
1476 <entry>Type of the right operand</entry>
1480 <entry>oprresult</entry>
1481 <entry><type>oid</type></entry>
1482 <entry>pg_type.oid</entry>
1483 <entry>Type of the result</entry>
1487 <entry>oprcom</entry>
1488 <entry><type>oid</type></entry>
1489 <entry>pg_operator.oid</entry>
1490 <entry>Commutator of this operator, if any</entry>
1494 <entry>oprnegate</entry>
1495 <entry><type>oid</type></entry>
1496 <entry>pg_operator.oid</entry>
1497 <entry>Negator of this operator, if any</entry>
1501 <entry>oprlsortop</entry>
1502 <entry><type>oid</type></entry>
1503 <entry>pg_operator.oid</entry>
1505 If this operator supports merge joins, the operator that sorts
1506 the type of the left-hand operand
1511 <entry>oprrsortop</entry>
1512 <entry><type>oid</type></entry>
1513 <entry>pg_operator.oid</entry>
1515 If this operator supports merge joins, the operator that sorts
1516 the type of the right-hand operand
1521 <entry>oprcode</entry>
1522 <entry><type>regproc</type></entry>
1524 <entry>Function that implements this operator</entry>
1528 <entry>oprrest</entry>
1529 <entry><type>regproc</type></entry>
1531 <entry>Restriction selectivity estimation function for this operator</entry>
1535 <entry>oprjoin</entry>
1536 <entry><type>regproc</type></entry>
1538 <entry>Join selectivity estimation function for this operator</entry>
1547 <sect1 id="catalog-pg-proc">
1548 <title>pg_proc</title>
1551 This catalog stores information about functions (or procedures).
1552 The description of <command>CREATE FUNCTION</command> and the
1553 <citetitle>Programmer's Guide</citetitle> contain more information
1554 about the meaning of some fields.
1558 <title>pg_proc Columns</title>
1565 <entry>References</entry>
1566 <entry>Description</entry>
1572 <entry>proname</entry>
1573 <entry><type>name</type></entry>
1575 <entry>Name of the function</entry>
1579 <entry>proowner</entry>
1580 <entry><type>int4</type></entry>
1581 <entry>pg_shadow.usesysid</entry>
1582 <entry>Owner (creator) of the function</entry>
1586 <entry>prolang</entry>
1587 <entry><type>oid</type></entry>
1588 <entry>pg_language.oid</entry>
1589 <entry>Implementation language or call interface of this function</entry>
1593 <entry>proisinh</entry>
1594 <entry><type>bool</type></entry>
1596 <entry>unused</entry>
1600 <entry>proistrusted</entry>
1601 <entry><type>bool</type></entry>
1603 <entry>not functional</entry>
1607 <entry>proiscachable</entry>
1608 <entry><type>bool</type></entry>
1610 <entry>Function returns same result for same input values</entry>
1614 <entry>proisstrict</entry>
1615 <entry><type>bool</type></entry>
1618 Function returns null if any call argument is null. In that
1619 case the function won't actually be called at all. Functions
1620 that are not <quote>strict</quote> must be prepared to handle
1626 <entry>pronargs</entry>
1627 <entry><type>int2</type></entry>
1629 <entry>Number of arguments</entry>
1633 <entry>proretset</entry>
1634 <entry><type>bool</type></entry>
1636 <entry>Function returns a set (ie, multiple values of the specified
1641 <entry>prorettype</entry>
1642 <entry><type>oid</type></entry>
1643 <entry>pg_type.oid</entry>
1644 <entry>Data type of the return value (0 if the function does not return a value)</entry>
1648 <entry>proargtypes</entry>
1649 <entry><type>oidvector</type></entry>
1650 <entry>pg_type.oid</entry>
1651 <entry>A vector with the data types of the function arguments</entry>
1655 <entry>probyte_pct</entry>
1656 <entry><type>int4</type></entry>
1658 <entry>dead code</entry>
1662 <entry>properbyte_cpu</entry>
1663 <entry><type>int4</type></entry>
1665 <entry>dead code</entry>
1669 <entry>propercall_cpu</entry>
1670 <entry><type>int4</type></entry>
1672 <entry>dead code</entry>
1676 <entry>prooutin_ratio</entry>
1677 <entry><type>int4</type></entry>
1679 <entry>dead code</entry>
1683 <entry>prosrc</entry>
1684 <entry><type>text</type></entry>
1687 This tells the function handler how to invoke the function. It
1688 might be the actual source code of the function for interpreted
1689 languages, a link symbol, a file name, or just about anything
1690 else, depending on the implementation language/call convention.
1695 <entry>probin</entry>
1696 <entry><type>bytea</type></entry>
1698 <entry>Additional information about how to invoke the function.
1699 Again, the interpretation is language-specific.
1707 Currently, prosrc contains the function's C-language name (link symbol)
1708 for compiled functions, both built-in and dynamically loaded. For all
1709 other language types, prosrc contains the function's source text.
1713 Currently, probin is unused except for dynamically-loaded C functions,
1714 for which it gives the name of the shared library file containing the
1721 <sect1 id="catalog-pg-relcheck">
1722 <title>pg_relcheck</title>
1725 This system catalog stores CHECK constraints on tables. (Column
1726 constraints are not treated specially. Every column constraint is
1727 equivalent to some table constraint.) See under <command>CREATE
1728 TABLE</command> for more information.
1732 <title>pg_relcheck Columns</title>
1739 <entry>References</entry>
1740 <entry>Description</entry>
1746 <entry>rcrelid</entry>
1747 <entry><type>oid</type></entry>
1748 <entry>pg_class.oid</entry>
1749 <entry>The table this check constraint is on</entry>
1753 <entry>rcname</entry>
1754 <entry><type>name</type></entry>
1756 <entry>Constraint name</entry>
1760 <entry>rcbin</entry>
1761 <entry><type>text</type></entry>
1763 <entry>An internal representation of the constraint expression</entry>
1767 <entry>rcsrc</entry>
1768 <entry><type>text</type></entry>
1770 <entry>A human-readable representation of the constraint expression</entry>
1778 <structname>pg_class</structname>.<structfield>relchecks</structfield>
1779 needs to match up with the entries in this table.
1786 <sect1 id="catalog-pg-rewrite">
1787 <title>pg_rewrite</title>
1790 This system catalog stores rewrite rules for tables and views.
1794 <title>pg_rewrite Columns</title>
1801 <entry>References</entry>
1802 <entry>Description</entry>
1808 <entry>rulename</entry>
1809 <entry><type>name</type></entry>
1811 <entry>Rule name</entry>
1815 <entry>ev_type</entry>
1816 <entry><type>char</type></entry>
1818 <entry>Event type that the rule is for: '1' = SELECT,
1819 '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry>
1823 <entry>ev_class</entry>
1824 <entry><type>oid</type></entry>
1825 <entry>pg_class.oid</entry>
1826 <entry>The table this rule is for</entry>
1830 <entry>ev_attr</entry>
1831 <entry><type>int2</type></entry>
1833 <entry>The column this rule is for (currently, always zero to
1834 indicate the whole table)</entry>
1838 <entry>is_instead</entry>
1839 <entry><type>bool</type></entry>
1841 <entry>True if the rule is an INSTEAD rule</entry>
1845 <entry>ev_qual</entry>
1846 <entry><type>text</type></entry>
1848 <entry>Expression tree (in the form of a nodeToString representation)
1849 for the rule's qualifying condition</entry>
1853 <entry>ev_action</entry>
1854 <entry><type>text</type></entry>
1856 <entry>Query tree (in the form of a nodeToString representation)
1857 for the rule's action</entry>
1865 <structname>pg_class</structname>.<structfield>relhasrules</structfield>
1866 must be true if a table has any rules in this catalog.
1873 <sect1 id="catalog-pg-shadow">
1874 <title>pg_shadow</title>
1877 <structname>pg_shadow</structname> contains information about
1878 database users. The name stems from the fact that this table
1879 should not be readable by the public since it contains passwords.
1880 <structname>pg_user</structname> is a publicly readable view on
1881 <structname>pg_shadow</structname> that blanks out the password field.
1885 The <citetitle>Administrator's Guide</citetitle> contains detailed
1886 information about user and permission management.
1890 Because user identities are cluster-wide,
1891 <structname>pg_shadow</structname>
1892 is shared across all databases of a cluster: there is only one
1893 copy of <structname>pg_shadow</structname> per cluster, not
1898 <title>pg_shadow Columns</title>
1905 <entry>References</entry>
1906 <entry>Description</entry>
1912 <entry>usename</entry>
1913 <entry><type>name</type></entry>
1915 <entry>User name</entry>
1919 <entry>usesysid</entry>
1920 <entry><type>int4</type></entry>
1922 <entry>User id (arbitrary number used to reference this user)</entry>
1926 <entry>usecreatedb</entry>
1927 <entry><type>bool</type></entry>
1929 <entry>User may create databases</entry>
1933 <entry>usetrace</entry>
1934 <entry><type>bool</type></entry>
1936 <entry>not used</entry>
1940 <entry>usesuper</entry>
1941 <entry><type>bool</type></entry>
1943 <entry>User is a superuser</entry>
1947 <entry>usecatupd</entry>
1948 <entry><type>bool</type></entry>
1951 User may update system catalogs. (Even a superuser may not do
1952 this unless this attribute is true.)
1957 <entry>passwd</entry>
1958 <entry><type>text</type></entry>
1960 <entry>Password</entry>
1964 <entry>valuntil</entry>
1965 <entry><type>abstime</type></entry>
1967 <entry>Account expiry time (only used for password authentication)</entry>
1976 <sect1 id="catalog-pg-statistic">
1977 <title>pg_statistic</title>
1980 <structname>pg_statistic</structname> stores statistical data about
1981 the contents of the database. Entries are created by
1982 <command>ANALYZE</command> and subsequently used by the query planner.
1983 There is one entry for each table column that has been analyzed.
1984 Note that all the statistical data is inherently approximate,
1985 even assuming that it is up-to-date.
1989 Since different kinds of statistics may be appropriate for different
1990 kinds of data, <structname>pg_statistic</structname> is designed not
1991 to assume very much about what sort of statistics it stores. Only
1992 extremely general statistics (such as NULL-ness) are given dedicated
1993 columns in <structname>pg_statistic</structname>. Everything else
1994 is stored in <quote>slots</quote>, which are groups of associated columns whose
1995 content is identified by a code number in one of the slot's columns.
1996 For more information see
1997 <filename>src/include/catalog/pg_statistic.h</filename>.
2001 <structname>pg_statistic</structname> should not be readable by the
2002 public, since even statistical information about a table's contents
2003 may be considered sensitive. (Example: minimum and maximum values
2004 of a salary column might be quite interesting.)
2005 <structname>pg_stats</structname> is a publicly readable view on
2006 <structname>pg_statistic</structname> that only exposes information
2007 about those tables that are readable by the current user.
2008 <structname>pg_stats</structname> is also designed to present the
2009 information in a more readable format than the underlying
2010 <structname>pg_statistic</structname> table --- at the cost that
2011 its schema must be extended whenever new slot types are added.
2015 <title>pg_statistic Columns</title>
2022 <entry>References</entry>
2023 <entry>Description</entry>
2029 <entry>starelid</entry>
2030 <entry><type>oid</type></entry>
2031 <entry>pg_class.oid</entry>
2032 <entry>The table that the described column belongs to</entry>
2036 <entry>staattnum</entry>
2037 <entry><type>int2</type></entry>
2038 <entry>pg_attribute.attnum</entry>
2039 <entry>The number of the described column</entry>
2043 <entry>stanullfrac</entry>
2044 <entry><type>float4</type></entry>
2046 <entry>The fraction of the column's entries that are NULL</entry>
2050 <entry>stawidth</entry>
2051 <entry><type>int4</type></entry>
2053 <entry>The average stored width, in bytes, of non-NULL entries</entry>
2057 <entry>stadistinct</entry>
2058 <entry><type>float4</type></entry>
2060 <entry>The number of distinct non-NULL data values in the column.
2061 A value greater than zero is the actual number of distinct values.
2062 A value less than zero is the negative of a fraction of the number
2063 of rows in the table (for example, a column in which values appear about
2064 twice on the average could be represented by stadistinct = -0.5).
2065 A zero value means the number of distinct values is unknown.
2070 <entry>stakindN</entry>
2071 <entry><type>int2</type></entry>
2073 <entry>A code number indicating the kind of statistics stored in the Nth
2074 <quote>slot</quote> of the <structname>pg_statistic</structname> row.
2079 <entry>staopN</entry>
2080 <entry><type>oid</type></entry>
2081 <entry>pg_operator.oid</entry>
2082 <entry>An operator used to derive the statistics stored in the
2083 Nth <quote>slot</quote>. For example, a histogram slot would show the <literal><</literal>
2084 operator that defines the sort order of the data.
2089 <entry>stanumbersN</entry>
2090 <entry><type>float4[]</type></entry>
2092 <entry>Numerical statistics of the appropriate kind for the Nth
2093 <quote>slot</quote>, or NULL if the slot kind does not involve numerical values.
2098 <entry>stavaluesN</entry>
2099 <entry><type>text[]</type></entry>
2101 <entry>Column data values of the appropriate kind for the Nth
2102 <quote>slot</quote>, or NULL if the slot kind does not store any data values.
2103 For datatype independence, all column data values are converted
2104 to external textual form and stored as TEXT datums.
2114 <sect1 id="catalog-pg-trigger">
2115 <title>pg_trigger</title>
2118 This system catalog stores triggers on tables. See under
2119 <command>CREATE TRIGGER</command> for more information.
2123 <title>pg_trigger Columns</title>
2130 <entry>References</entry>
2131 <entry>Description</entry>
2137 <entry>tgrelid</entry>
2138 <entry><type>oid</type></entry>
2139 <entry>pg_class.oid</entry>
2140 <entry>The table this trigger is on</entry>
2144 <entry>tgname</entry>
2145 <entry><type>name</type></entry>
2147 <entry>Trigger name (need not be unique)</entry>
2151 <entry>tgfoid</entry>
2152 <entry><type>oid</type></entry>
2153 <entry>pg_proc.oid</entry>
2154 <entry>The function to be called</entry>
2158 <entry>tgtype</entry>
2159 <entry><type>int2</type></entry>
2161 <entry>Bitmask identifying trigger conditions</entry>
2165 <entry>tgenabled</entry>
2166 <entry><type>bool</type></entry>
2168 <entry>True if trigger is enabled (not presently checked everywhere
2169 it should be, so disabling a trigger by setting this false does not
2170 work reliably)</entry>
2174 <entry>tgisconstraint</entry>
2175 <entry><type>bool</type></entry>
2177 <entry>True if trigger is a RI constraint</entry>
2181 <entry>tgconstrname</entry>
2182 <entry><type>name</type></entry>
2184 <entry>RI constraint name</entry>
2188 <entry>tgconstrrelid</entry>
2189 <entry><type>oid</type></entry>
2190 <entry>pg_class.oid</entry>
2191 <entry>The table referenced by an RI constraint</entry>
2195 <entry>tgdeferrable</entry>
2196 <entry><type>bool</type></entry>
2198 <entry>True if deferrable</entry>
2202 <entry>tginitdeferred</entry>
2203 <entry><type>bool</type></entry>
2205 <entry>True if initially deferred</entry>
2209 <entry>tgnargs</entry>
2210 <entry><type>int2</type></entry>
2212 <entry>Number of argument strings passed to trigger function</entry>
2216 <entry>tgattr</entry>
2217 <entry><type>int2vector</type></entry>
2219 <entry>Currently unused</entry>
2223 <entry>tgargs</entry>
2224 <entry><type>bytea</type></entry>
2226 <entry>Argument strings to pass to trigger, each null-terminated</entry>
2234 <structname>pg_class</structname>.<structfield>reltriggers</structfield>
2235 needs to match up with the entries in this table.
2242 <sect1 id="catalog-pg-type">
2243 <title>pg_type</title>
2246 This catalog stores information about datatypes. Scalar types
2247 (<quote>base types</>) are created with <command>CREATE TYPE</command>.
2248 A complex type is also created for each table in the database, to
2249 represent the row structure of the table.
2253 <title>pg_type Columns</title>
2260 <entry>References</entry>
2261 <entry>Description</entry>
2267 <entry>typname</entry>
2268 <entry><type>name</type></entry>
2270 <entry>Data type name</entry>
2274 <entry>typowner</entry>
2275 <entry><type>int4</type></entry>
2276 <entry>pg_shadow.usesysid</entry>
2277 <entry>Owner (creator) of the type</entry>
2281 <entry>typlen</entry>
2282 <entry><type>int2</type></entry>
2284 <entry>Length of the storage representation of the type, -1 if variable length</entry>
2288 <entry>typprtlen</entry>
2289 <entry><type>int2</type></entry>
2291 <entry>unused</entry>
2295 <entry>typbyval</entry>
2296 <entry><type>bool</type></entry>
2299 <structfield>typbyval</structfield> determines whether internal
2300 routines pass a value of this type by value or by reference.
2301 Only <type>char</type>, <type>short</type>, and
2302 <type>int</type> equivalent items can be passed by value, so if
2303 the type is not 1, 2, or 4 bytes long,
2304 <productname>PostgreSQL</> does not have
2305 the option of passing by value and so
2306 <structfield>typbyval</structfield> had better be false.
2307 Variable-length types are always passed by reference. Note that
2308 <structfield>typbyval</structfield> can be false even if the
2309 length would allow pass-by-value; this is currently true for
2310 type <type>float4</type>, for example.
2315 <entry>typtype</entry>
2316 <entry><type>char</type></entry>
2319 <structfield>typtype</structfield> is <literal>b</literal> for
2320 a base type and <literal>c</literal> for a complex type (i.e.,
2321 a table's row type). If <structfield>typtype</structfield> is
2322 <literal>c</literal>, <structfield>typrelid</structfield> is
2323 the OID of the type's entry in
2324 <structname>pg_class</structname>.
2329 <entry>typisdefined</entry>
2330 <entry><type>bool</type></entry>
2332 <entry>True if the type is defined, false if this is a placeholder
2333 entry for a not-yet-defined type. When typisdefined is false,
2334 nothing except the type name and OID can be relied on.
2339 <entry>typdelim</entry>
2340 <entry><type>char</type></entry>
2342 <entry>Character that separates two values of this type when parsing
2343 array input. Note that the delimiter is associated with the array
2344 element datatype, not the array datatype.</entry>
2348 <entry>typrelid</entry>
2349 <entry><type>oid</type></entry>
2350 <entry>pg_class.oid</entry>
2352 If this is a complex type (see
2353 <structfield>typtype</structfield>), then this field points to
2354 the <structfield>pg_class</structfield> entry that defines the
2355 corresponding table. A table could theoretically be used as a
2356 composite data type, but this is not fully functional.
2361 <entry>typelem</entry>
2362 <entry><type>oid</type></entry>
2363 <entry>pg_type.oid</entry>
2365 If <structfield>typelem</structfield> is not 0 then it
2366 identifies another row in <structname>pg_type</structname>.
2367 The current type can then be subscripted like an array yielding
2368 values of type <structfield>typelem</structfield>. A
2369 <quote>true</quote> array type is variable length
2370 (<structfield>typlen</structfield> = -1),
2371 but some fixed-length (<structfield>typlen</structfield> > 0) types
2372 also have nonzero <structfield>typelem</structfield>, for example
2373 <type>name</type> and <type>oidvector</type>.
2374 If a fixed-length type has a <structfield>typelem</structfield> then
2375 its internal representation must be N values of the
2376 <structfield>typelem</structfield> datatype with no other data.
2377 Variable-length array types have a header defined by the array
2383 <entry>typinput</entry>
2384 <entry><type>regproc</type></entry>
2386 <entry>Input function</entry>
2390 <entry>typoutput</entry>
2391 <entry><type>regproc</type></entry>
2393 <entry>Output function</entry>
2397 <entry>typreceive</entry>
2398 <entry><type>regproc</type></entry>
2400 <entry>unused</entry>
2404 <entry>typsend</entry>
2405 <entry><type>regproc</type></entry>
2407 <entry>unused</entry>
2411 <entry>typalign</entry>
2412 <entry><type>char</type></entry>
2416 <structfield>typalign</structfield> is the alignment required
2417 when storing a value of this type. It applies to storage on
2418 disk as well as most representations of the value inside
2419 <productname>PostgreSQL</>.
2420 When multiple values are stored consecutively, such
2421 as in the representation of a complete row on disk, padding is
2422 inserted before a datum of this type so that it begins on the
2423 specified boundary. The alignment reference is the beginning
2424 of the first datum in the sequence.
2426 Possible values are:
2429 <para>'c' = CHAR alignment, i.e., no alignment needed.</para>
2432 <para>'s' = SHORT alignment (2 bytes on most machines).</para>
2435 <para>'i' = INT alignment (4 bytes on most machines).</para>
2438 <para>'d' = DOUBLE alignment (8 bytes on many machines, but by no means all).</para>
2443 For types used in system tables, it is critical that the size
2444 and alignment defined in <structname>pg_type</structname>
2445 agree with the way that the compiler will lay out the field in
2446 a struct representing a table row.
2452 <entry>typstorage</entry>
2453 <entry><type>char</type></entry>
2456 <structfield>typstorage</structfield> tells for variable-length
2457 types (those with <structfield>typlen</structfield> = -1) if
2458 the type is prepared for toasting and what the default strategy
2459 for attributes of this type should be.
2463 <para>'p': Value must always be stored plain.</para>
2467 'e': Value can be stored in a <quote>secondary</quote>
2468 relation (if relation has one, see
2469 <structname>pg_class</structname>.<structfield>reltoastrelid</structfield>).
2473 <para>'m': Value can be stored compressed inline.</para>
2476 <para>'x': Value can be stored compressed inline or in <quote>secondary</quote>.</para>
2479 Note that 'm' fields can also be moved out to secondary
2480 storage, but only as a last resort ('e' and 'x' fields are
2486 <entry>typdefault</entry>
2487 <entry><type>text</type></entry>
2490 <structfield>typdefault</structfield> is NULL for types without a
2491 default value. If it's not NULL, it contains the external string
2492 representation of the type's default value.
2501 <!-- Keep this comment at the end of the file
2506 sgml-minimize-attributes:nil
2507 sgml-always-quote-attributes:t
2509 sgml-indent-tabs-mode:nil
2511 sgml-parent-document:nil
2512 sgml-default-dtd-file:"./reference.ced"
2513 sgml-exposed-tags:nil
2514 sgml-local-catalogs:("/usr/share/sgml/catalog")
2515 sgml-local-ecat-files:nil