1 <!-- doc/src/sgml/catalogs.sgml -->
3 Documentation of the system catalogs, directed toward PostgreSQL developers
6 <chapter id="catalogs">
7 <title>System Catalogs</title>
10 The system catalogs are the place where a relational database
11 management system stores schema metadata, such as information about
12 tables and columns, and internal bookkeeping information.
13 <productname>PostgreSQL</productname>'s system catalogs are regular
14 tables. You can drop and recreate the tables, add columns, insert
15 and update values, and severely mess up your system that way.
16 Normally, one should not change the system catalogs by hand, there
17 are normally SQL commands to do that. (For example, <command>CREATE
18 DATABASE</command> inserts a row into the
19 <structname>pg_database</structname> catalog — and actually
20 creates the database on disk.) There are some exceptions for
21 particularly esoteric operations, but many of those have been made
22 available as SQL commands over time, and so the need for direct manipulation
23 of the system catalogs is ever decreasing.
26 <sect1 id="catalogs-overview">
27 <title>Overview</title>
30 <xref linkend="catalog-table"/> lists the system catalogs.
31 More detailed documentation of each catalog follows below.
35 Most system catalogs are copied from the template database during
36 database creation and are thereafter database-specific. A few
37 catalogs are physically shared across all databases in a cluster;
38 these are noted in the descriptions of the individual catalogs.
41 <table id="catalog-table">
42 <title>System Catalogs</title>
47 <entry>Catalog Name</entry>
48 <entry>Purpose</entry>
54 <entry><link linkend="catalog-pg-aggregate"><structname>pg_aggregate</structname></link></entry>
55 <entry>aggregate functions</entry>
59 <entry><link linkend="catalog-pg-am"><structname>pg_am</structname></link></entry>
60 <entry>index access methods</entry>
64 <entry><link linkend="catalog-pg-amop"><structname>pg_amop</structname></link></entry>
65 <entry>access method operators</entry>
69 <entry><link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link></entry>
70 <entry>access method support procedures</entry>
74 <entry><link linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link></entry>
75 <entry>column default values</entry>
79 <entry><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link></entry>
80 <entry>table columns (<quote>attributes</quote>)</entry>
84 <entry><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link></entry>
85 <entry>authorization identifiers (roles)</entry>
89 <entry><link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link></entry>
90 <entry>authorization identifier membership relationships</entry>
94 <entry><link linkend="catalog-pg-cast"><structname>pg_cast</structname></link></entry>
95 <entry>casts (data type conversions)</entry>
99 <entry><link linkend="catalog-pg-class"><structname>pg_class</structname></link></entry>
100 <entry>tables, indexes, sequences, views (<quote>relations</quote>)</entry>
104 <entry><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link></entry>
105 <entry>collations (locale information)</entry>
109 <entry><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link></entry>
110 <entry>check constraints, unique constraints, primary key constraints, foreign key constraints</entry>
114 <entry><link linkend="catalog-pg-conversion"><structname>pg_conversion</structname></link></entry>
115 <entry>encoding conversion information</entry>
119 <entry><link linkend="catalog-pg-database"><structname>pg_database</structname></link></entry>
120 <entry>databases within this database cluster</entry>
124 <entry><link linkend="catalog-pg-db-role-setting"><structname>pg_db_role_setting</structname></link></entry>
125 <entry>per-role and per-database settings</entry>
129 <entry><link linkend="catalog-pg-default-acl"><structname>pg_default_acl</structname></link></entry>
130 <entry>default privileges for object types</entry>
134 <entry><link linkend="catalog-pg-depend"><structname>pg_depend</structname></link></entry>
135 <entry>dependencies between database objects</entry>
139 <entry><link linkend="catalog-pg-description"><structname>pg_description</structname></link></entry>
140 <entry>descriptions or comments on database objects</entry>
144 <entry><link linkend="catalog-pg-enum"><structname>pg_enum</structname></link></entry>
145 <entry>enum label and value definitions</entry>
149 <entry><link linkend="catalog-pg-event-trigger"><structname>pg_event_trigger</structname></link></entry>
150 <entry>event triggers</entry>
154 <entry><link linkend="catalog-pg-extension"><structname>pg_extension</structname></link></entry>
155 <entry>installed extensions</entry>
159 <entry><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link></entry>
160 <entry>foreign-data wrapper definitions</entry>
164 <entry><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link></entry>
165 <entry>foreign server definitions</entry>
169 <entry><link linkend="catalog-pg-foreign-table"><structname>pg_foreign_table</structname></link></entry>
170 <entry>additional foreign table information</entry>
174 <entry><link linkend="catalog-pg-index"><structname>pg_index</structname></link></entry>
175 <entry>additional index information</entry>
179 <entry><link linkend="catalog-pg-inherits"><structname>pg_inherits</structname></link></entry>
180 <entry>table inheritance hierarchy</entry>
184 <entry><link linkend="catalog-pg-init-privs"><structname>pg_init_privs</structname></link></entry>
185 <entry>object initial privileges</entry>
189 <entry><link linkend="catalog-pg-language"><structname>pg_language</structname></link></entry>
190 <entry>languages for writing functions</entry>
194 <entry><link linkend="catalog-pg-largeobject"><structname>pg_largeobject</structname></link></entry>
195 <entry>data pages for large objects</entry>
199 <entry><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link></entry>
200 <entry>metadata for large objects</entry>
204 <entry><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link></entry>
205 <entry>schemas</entry>
209 <entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link></entry>
210 <entry>access method operator classes</entry>
214 <entry><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link></entry>
215 <entry>operators</entry>
219 <entry><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link></entry>
220 <entry>access method operator families</entry>
224 <entry><link linkend="catalog-pg-partitioned-table"><structname>pg_partitioned_table</structname></link></entry>
225 <entry>information about partition key of tables</entry>
229 <entry><link linkend="catalog-pg-pltemplate"><structname>pg_pltemplate</structname></link></entry>
230 <entry>template data for procedural languages</entry>
234 <entry><link linkend="catalog-pg-policy"><structname>pg_policy</structname></link></entry>
235 <entry>row-security policies</entry>
239 <entry><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link></entry>
240 <entry>functions and procedures</entry>
244 <entry><link linkend="catalog-pg-publication"><structname>pg_publication</structname></link></entry>
245 <entry>publications for logical replication</entry>
249 <entry><link linkend="catalog-pg-publication-rel"><structname>pg_publication_rel</structname></link></entry>
250 <entry>relation to publication mapping</entry>
254 <entry><link linkend="catalog-pg-range"><structname>pg_range</structname></link></entry>
255 <entry>information about range types</entry>
259 <entry><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link></entry>
260 <entry>registered replication origins</entry>
264 <entry><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link></entry>
265 <entry>query rewrite rules</entry>
269 <entry><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link></entry>
270 <entry>security labels on database objects</entry>
274 <entry><link linkend="catalog-pg-sequence"><structname>pg_sequence</structname></link></entry>
275 <entry>information about sequences</entry>
279 <entry><link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link></entry>
280 <entry>dependencies on shared objects</entry>
284 <entry><link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link></entry>
285 <entry>comments on shared objects</entry>
289 <entry><link linkend="catalog-pg-shseclabel"><structname>pg_shseclabel</structname></link></entry>
290 <entry>security labels on shared database objects</entry>
294 <entry><link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link></entry>
295 <entry>planner statistics</entry>
299 <entry><link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link></entry>
300 <entry>extended planner statistics</entry>
304 <entry><link linkend="catalog-pg-subscription"><structname>pg_subscription</structname></link></entry>
305 <entry>logical replication subscriptions</entry>
309 <entry><link linkend="catalog-pg-subscription-rel"><structname>pg_subscription_rel</structname></link></entry>
310 <entry>relation state for subscriptions</entry>
314 <entry><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link></entry>
315 <entry>tablespaces within this database cluster</entry>
319 <entry><link linkend="catalog-pg-transform"><structname>pg_transform</structname></link></entry>
320 <entry>transforms (data type to procedural language conversions)</entry>
324 <entry><link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link></entry>
325 <entry>triggers</entry>
329 <entry><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link></entry>
330 <entry>text search configurations</entry>
334 <entry><link linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link></entry>
335 <entry>text search configurations' token mappings</entry>
339 <entry><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link></entry>
340 <entry>text search dictionaries</entry>
344 <entry><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link></entry>
345 <entry>text search parsers</entry>
349 <entry><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link></entry>
350 <entry>text search templates</entry>
354 <entry><link linkend="catalog-pg-type"><structname>pg_type</structname></link></entry>
355 <entry>data types</entry>
359 <entry><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link></entry>
360 <entry>mappings of users to foreign servers</entry>
368 <sect1 id="catalog-pg-aggregate">
369 <title><structname>pg_aggregate</structname></title>
371 <indexterm zone="catalog-pg-aggregate">
372 <primary>pg_aggregate</primary>
376 The catalog <structname>pg_aggregate</structname> stores information about
377 aggregate functions. An aggregate function is a function that
378 operates on a set of values (typically one column from each row
379 that matches a query condition) and returns a single value computed
380 from all these values. Typical aggregate functions are
381 <function>sum</function>, <function>count</function>, and
382 <function>max</function>. Each entry in
383 <structname>pg_aggregate</structname> is an extension of an entry
384 in <structname>pg_proc</structname>. The <structname>pg_proc</structname>
385 entry carries the aggregate's name, input and output data types, and
386 other information that is similar to ordinary functions.
390 <title><structname>pg_aggregate</structname> Columns</title>
397 <entry>References</entry>
398 <entry>Description</entry>
403 <entry><structfield>aggfnoid</structfield></entry>
404 <entry><type>regproc</type></entry>
405 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
406 <entry><structname>pg_proc</structname> OID of the aggregate function</entry>
409 <entry><structfield>aggkind</structfield></entry>
410 <entry><type>char</type></entry>
412 <entry>Aggregate kind:
413 <literal>n</literal> for <quote>normal</quote> aggregates,
414 <literal>o</literal> for <quote>ordered-set</quote> aggregates, or
415 <literal>h</literal> for <quote>hypothetical-set</quote> aggregates
419 <entry><structfield>aggnumdirectargs</structfield></entry>
420 <entry><type>int2</type></entry>
422 <entry>Number of direct (non-aggregated) arguments of an ordered-set or
423 hypothetical-set aggregate, counting a variadic array as one argument.
424 If equal to <structfield>pronargs</structfield>, the aggregate must be variadic
425 and the variadic array describes the aggregated arguments as well as
426 the final direct arguments.
427 Always zero for normal aggregates.</entry>
430 <entry><structfield>aggtransfn</structfield></entry>
431 <entry><type>regproc</type></entry>
432 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
433 <entry>Transition function</entry>
436 <entry><structfield>aggfinalfn</structfield></entry>
437 <entry><type>regproc</type></entry>
438 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
439 <entry>Final function (zero if none)</entry>
442 <entry><structfield>aggcombinefn</structfield></entry>
443 <entry><type>regproc</type></entry>
444 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
445 <entry>Combine function (zero if none)</entry>
448 <entry><structfield>aggserialfn</structfield></entry>
449 <entry><type>regproc</type></entry>
450 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
451 <entry>Serialization function (zero if none)</entry>
454 <entry><structfield>aggdeserialfn</structfield></entry>
455 <entry><type>regproc</type></entry>
456 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
457 <entry>Deserialization function (zero if none)</entry>
460 <entry><structfield>aggmtransfn</structfield></entry>
461 <entry><type>regproc</type></entry>
462 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
463 <entry>Forward transition function for moving-aggregate mode (zero if none)</entry>
466 <entry><structfield>aggminvtransfn</structfield></entry>
467 <entry><type>regproc</type></entry>
468 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
469 <entry>Inverse transition function for moving-aggregate mode (zero if none)</entry>
472 <entry><structfield>aggmfinalfn</structfield></entry>
473 <entry><type>regproc</type></entry>
474 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
475 <entry>Final function for moving-aggregate mode (zero if none)</entry>
478 <entry><structfield>aggfinalextra</structfield></entry>
479 <entry><type>bool</type></entry>
481 <entry>True to pass extra dummy arguments to <structfield>aggfinalfn</structfield></entry>
484 <entry><structfield>aggmfinalextra</structfield></entry>
485 <entry><type>bool</type></entry>
487 <entry>True to pass extra dummy arguments to <structfield>aggmfinalfn</structfield></entry>
490 <entry><structfield>aggfinalmodify</structfield></entry>
491 <entry><type>char</type></entry>
493 <entry>Whether <structfield>aggfinalfn</structfield> modifies the
494 transition state value:
495 <literal>r</literal> if it is read-only,
496 <literal>s</literal> if the <structfield>aggtransfn</structfield>
497 cannot be applied after the <structfield>aggfinalfn</structfield>, or
498 <literal>w</literal> if it writes on the value
502 <entry><structfield>aggmfinalmodify</structfield></entry>
503 <entry><type>char</type></entry>
505 <entry>Like <structfield>aggfinalmodify</structfield>, but for
506 the <structfield>aggmfinalfn</structfield>
510 <entry><structfield>aggsortop</structfield></entry>
511 <entry><type>oid</type></entry>
512 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
513 <entry>Associated sort operator (zero if none)</entry>
516 <entry><structfield>aggtranstype</structfield></entry>
517 <entry><type>oid</type></entry>
518 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
519 <entry>Data type of the aggregate function's internal transition (state) data</entry>
522 <entry><structfield>aggtransspace</structfield></entry>
523 <entry><type>int4</type></entry>
525 <entry>Approximate average size (in bytes) of the transition state
526 data, or zero to use a default estimate</entry>
529 <entry><structfield>aggmtranstype</structfield></entry>
530 <entry><type>oid</type></entry>
531 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
532 <entry>Data type of the aggregate function's internal transition (state)
533 data for moving-aggregate mode (zero if none)</entry>
536 <entry><structfield>aggmtransspace</structfield></entry>
537 <entry><type>int4</type></entry>
539 <entry>Approximate average size (in bytes) of the transition state data
540 for moving-aggregate mode, or zero to use a default estimate</entry>
543 <entry><structfield>agginitval</structfield></entry>
544 <entry><type>text</type></entry>
547 The initial value of the transition state. This is a text
548 field containing the initial value in its external string
549 representation. If this field is null, the transition state
550 value starts out null.
554 <entry><structfield>aggminitval</structfield></entry>
555 <entry><type>text</type></entry>
558 The initial value of the transition state for moving-aggregate mode.
559 This is a text field containing the initial value in its external
560 string representation. If this field is null, the transition state
561 value starts out null.
569 New aggregate functions are registered with the <xref
570 linkend="sql-createaggregate"/>
571 command. See <xref linkend="xaggr"/> for more information about
572 writing aggregate functions and the meaning of the transition
579 <sect1 id="catalog-pg-am">
580 <title><structname>pg_am</structname></title>
582 <indexterm zone="catalog-pg-am">
583 <primary>pg_am</primary>
587 The catalog <structname>pg_am</structname> stores information about
588 relation access methods. There is one row for each access method supported
590 Currently, only indexes have access methods. The requirements for index
591 access methods are discussed in detail in <xref linkend="indexam"/>.
595 <title><structname>pg_am</structname> Columns</title>
602 <entry>References</entry>
603 <entry>Description</entry>
609 <entry><structfield>oid</structfield></entry>
610 <entry><type>oid</type></entry>
612 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
616 <entry><structfield>amname</structfield></entry>
617 <entry><type>name</type></entry>
619 <entry>Name of the access method</entry>
623 <entry><structfield>amhandler</structfield></entry>
624 <entry><type>regproc</type></entry>
625 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
627 OID of a handler function that is responsible for supplying information
628 about the access method
633 <entry><structfield>amtype</structfield></entry>
634 <entry><type>char</type></entry>
637 Currently always <literal>i</literal> to indicate an index access
638 method; other values may be allowed in future
647 Before <productname>PostgreSQL</productname> 9.6, <structname>pg_am</structname>
648 contained many additional columns representing properties of index access
649 methods. That data is now only directly visible at the C code level.
650 However, <function>pg_index_column_has_property()</function> and related
651 functions have been added to allow SQL queries to inspect index access
652 method properties; see <xref linkend="functions-info-catalog-table"/>.
659 <sect1 id="catalog-pg-amop">
660 <title><structname>pg_amop</structname></title>
662 <indexterm zone="catalog-pg-amop">
663 <primary>pg_amop</primary>
667 The catalog <structname>pg_amop</structname> stores information about
668 operators associated with access method operator families. There is one
669 row for each operator that is a member of an operator family. A family
670 member can be either a <firstterm>search</firstterm> operator or an
671 <firstterm>ordering</firstterm> operator. An operator
672 can appear in more than one family, but cannot appear in more than one
673 search position nor more than one ordering position within a family.
674 (It is allowed, though unlikely, for an operator to be used for both
675 search and ordering purposes.)
679 <title><structname>pg_amop</structname> Columns</title>
686 <entry>References</entry>
687 <entry>Description</entry>
693 <entry><structfield>oid</structfield></entry>
694 <entry><type>oid</type></entry>
696 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
700 <entry><structfield>amopfamily</structfield></entry>
701 <entry><type>oid</type></entry>
702 <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
703 <entry>The operator family this entry is for</entry>
707 <entry><structfield>amoplefttype</structfield></entry>
708 <entry><type>oid</type></entry>
709 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
710 <entry>Left-hand input data type of operator</entry>
714 <entry><structfield>amoprighttype</structfield></entry>
715 <entry><type>oid</type></entry>
716 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
717 <entry>Right-hand input data type of operator</entry>
721 <entry><structfield>amopstrategy</structfield></entry>
722 <entry><type>int2</type></entry>
724 <entry>Operator strategy number</entry>
728 <entry><structfield>amoppurpose</structfield></entry>
729 <entry><type>char</type></entry>
731 <entry>Operator purpose, either <literal>s</literal> for search or
732 <literal>o</literal> for ordering</entry>
736 <entry><structfield>amopopr</structfield></entry>
737 <entry><type>oid</type></entry>
738 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
739 <entry>OID of the operator</entry>
743 <entry><structfield>amopmethod</structfield></entry>
744 <entry><type>oid</type></entry>
745 <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
746 <entry>Index access method operator family is for</entry>
750 <entry><structfield>amopsortfamily</structfield></entry>
751 <entry><type>oid</type></entry>
752 <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
753 <entry>The B-tree operator family this entry sorts according to, if an
754 ordering operator; zero if a search operator</entry>
762 A <quote>search</quote> operator entry indicates that an index of this operator
763 family can be searched to find all rows satisfying
764 <literal>WHERE</literal>
765 <replaceable>indexed_column</replaceable>
766 <replaceable>operator</replaceable>
767 <replaceable>constant</replaceable>.
768 Obviously, such an operator must return <type>boolean</type>, and its left-hand input
769 type must match the index's column data type.
773 An <quote>ordering</quote> operator entry indicates that an index of this
774 operator family can be scanned to return rows in the order represented by
775 <literal>ORDER BY</literal>
776 <replaceable>indexed_column</replaceable>
777 <replaceable>operator</replaceable>
778 <replaceable>constant</replaceable>.
779 Such an operator could return any sortable data type, though again
780 its left-hand input type must match the index's column data type.
781 The exact semantics of the <literal>ORDER BY</literal> are specified by the
782 <structfield>amopsortfamily</structfield> column, which must reference
783 a B-tree operator family for the operator's result type.
788 At present, it's assumed that the sort order for an ordering operator
789 is the default for the referenced operator family, i.e., <literal>ASC NULLS
790 LAST</literal>. This might someday be relaxed by adding additional columns
791 to specify sort options explicitly.
796 An entry's <structfield>amopmethod</structfield> must match the
797 <structname>opfmethod</structname> of its containing operator family (including
798 <structfield>amopmethod</structfield> here is an intentional denormalization of the
799 catalog structure for performance reasons). Also,
800 <structfield>amoplefttype</structfield> and <structfield>amoprighttype</structfield> must match
801 the <structfield>oprleft</structfield> and <structfield>oprright</structfield> fields of the
802 referenced <structname>pg_operator</structname> entry.
808 <sect1 id="catalog-pg-amproc">
809 <title><structname>pg_amproc</structname></title>
811 <indexterm zone="catalog-pg-amproc">
812 <primary>pg_amproc</primary>
816 The catalog <structname>pg_amproc</structname> stores information about
817 support procedures associated with access method operator families. There
818 is one row for each support procedure belonging to an operator family.
822 <title><structname>pg_amproc</structname> Columns</title>
829 <entry>References</entry>
830 <entry>Description</entry>
836 <entry><structfield>oid</structfield></entry>
837 <entry><type>oid</type></entry>
839 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
843 <entry><structfield>amprocfamily</structfield></entry>
844 <entry><type>oid</type></entry>
845 <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
846 <entry>The operator family this entry is for</entry>
850 <entry><structfield>amproclefttype</structfield></entry>
851 <entry><type>oid</type></entry>
852 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
853 <entry>Left-hand input data type of associated operator</entry>
857 <entry><structfield>amprocrighttype</structfield></entry>
858 <entry><type>oid</type></entry>
859 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
860 <entry>Right-hand input data type of associated operator</entry>
864 <entry><structfield>amprocnum</structfield></entry>
865 <entry><type>int2</type></entry>
867 <entry>Support procedure number</entry>
871 <entry><structfield>amproc</structfield></entry>
872 <entry><type>regproc</type></entry>
873 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
874 <entry>OID of the procedure</entry>
882 The usual interpretation of the
883 <structfield>amproclefttype</structfield> and <structfield>amprocrighttype</structfield> fields
884 is that they identify the left and right input types of the operator(s)
885 that a particular support procedure supports. For some access methods
886 these match the input data type(s) of the support procedure itself, for
887 others not. There is a notion of <quote>default</quote> support procedures for
888 an index, which are those with <structfield>amproclefttype</structfield> and
889 <structfield>amprocrighttype</structfield> both equal to the index operator class's
890 <structfield>opcintype</structfield>.
896 <sect1 id="catalog-pg-attrdef">
897 <title><structname>pg_attrdef</structname></title>
899 <indexterm zone="catalog-pg-attrdef">
900 <primary>pg_attrdef</primary>
904 The catalog <structname>pg_attrdef</structname> stores column default values. The main information
905 about columns is stored in <structname>pg_attribute</structname>
906 (see below). Only columns that explicitly specify a default value
907 (when the table is created or the column is added) will have an
912 <title><structname>pg_attrdef</structname> Columns</title>
919 <entry>References</entry>
920 <entry>Description</entry>
926 <entry><structfield>oid</structfield></entry>
927 <entry><type>oid</type></entry>
929 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
933 <entry><structfield>adrelid</structfield></entry>
934 <entry><type>oid</type></entry>
935 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
936 <entry>The table this column belongs to</entry>
940 <entry><structfield>adnum</structfield></entry>
941 <entry><type>int2</type></entry>
942 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
943 <entry>The number of the column</entry>
947 <entry><structfield>adbin</structfield></entry>
948 <entry><type>pg_node_tree</type></entry>
950 <entry>The internal representation of the column default value</entry>
954 <entry><structfield>adsrc</structfield></entry>
955 <entry><type>text</type></entry>
957 <entry>A human-readable representation of the default value</entry>
964 The <structfield>adsrc</structfield> field is historical, and is best
965 not used, because it does not track outside changes that might affect
966 the representation of the default value. Reverse-compiling the
967 <structfield>adbin</structfield> field (with <function>pg_get_expr</function> for
968 example) is a better way to display the default value.
974 <sect1 id="catalog-pg-attribute">
975 <title><structname>pg_attribute</structname></title>
977 <indexterm zone="catalog-pg-attribute">
978 <primary>pg_attribute</primary>
982 The catalog <structname>pg_attribute</structname> stores information about
983 table columns. There will be exactly one
984 <structname>pg_attribute</structname> row for every column in every
985 table in the database. (There will also be attribute entries for
986 indexes, and indeed all objects that have <structname>pg_class</structname>
991 The term attribute is equivalent to column and is used for
996 <title><structname>pg_attribute</structname> Columns</title>
1003 <entry>References</entry>
1004 <entry>Description</entry>
1010 <entry><structfield>attrelid</structfield></entry>
1011 <entry><type>oid</type></entry>
1012 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
1013 <entry>The table this column belongs to</entry>
1017 <entry><structfield>attname</structfield></entry>
1018 <entry><type>name</type></entry>
1020 <entry>The column name</entry>
1024 <entry><structfield>atttypid</structfield></entry>
1025 <entry><type>oid</type></entry>
1026 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
1027 <entry>The data type of this column</entry>
1031 <entry><structfield>attstattarget</structfield></entry>
1032 <entry><type>int4</type></entry>
1035 <structfield>attstattarget</structfield> controls the level of detail
1036 of statistics accumulated for this column by
1037 <xref linkend="sql-analyze"/>.
1038 A zero value indicates that no statistics should be collected.
1039 A negative value says to use the system default statistics target.
1040 The exact meaning of positive values is data type-dependent.
1041 For scalar data types, <structfield>attstattarget</structfield>
1042 is both the target number of <quote>most common values</quote>
1043 to collect, and the target number of histogram bins to create.
1048 <entry><structfield>attlen</structfield></entry>
1049 <entry><type>int2</type></entry>
1052 A copy of <literal>pg_type.typlen</literal> of this column's
1058 <entry><structfield>attnum</structfield></entry>
1059 <entry><type>int2</type></entry>
1062 The number of the column. Ordinary columns are numbered from 1
1063 up. System columns, such as <structfield>oid</structfield>,
1064 have (arbitrary) negative numbers.
1069 <entry><structfield>attndims</structfield></entry>
1070 <entry><type>int4</type></entry>
1073 Number of dimensions, if the column is an array type; otherwise 0.
1074 (Presently, the number of dimensions of an array is not enforced,
1075 so any nonzero value effectively means <quote>it's an array</quote>.)
1080 <entry><structfield>attcacheoff</structfield></entry>
1081 <entry><type>int4</type></entry>
1084 Always -1 in storage, but when loaded into a row descriptor
1085 in memory this might be updated to cache the offset of the attribute
1091 <entry><structfield>atttypmod</structfield></entry>
1092 <entry><type>int4</type></entry>
1095 <structfield>atttypmod</structfield> records type-specific data
1096 supplied at table creation time (for example, the maximum
1097 length of a <type>varchar</type> column). It is passed to
1098 type-specific input functions and length coercion functions.
1099 The value will generally be -1 for types that do not need <structfield>atttypmod</structfield>.
1104 <entry><structfield>attbyval</structfield></entry>
1105 <entry><type>bool</type></entry>
1108 A copy of <literal>pg_type.typbyval</literal> of this column's type
1113 <entry><structfield>attstorage</structfield></entry>
1114 <entry><type>char</type></entry>
1117 Normally a copy of <literal>pg_type.typstorage</literal> of this
1118 column's type. For TOAST-able data types, this can be altered
1119 after column creation to control storage policy.
1124 <entry><structfield>attalign</structfield></entry>
1125 <entry><type>char</type></entry>
1128 A copy of <literal>pg_type.typalign</literal> of this column's type
1133 <entry><structfield>attnotnull</structfield></entry>
1134 <entry><type>bool</type></entry>
1137 This represents a not-null constraint.
1142 <entry><structfield>atthasdef</structfield></entry>
1143 <entry><type>bool</type></entry>
1146 This column has a default value, in which case there will be a
1147 corresponding entry in the <structname>pg_attrdef</structname>
1148 catalog that actually defines the value.
1153 <entry><structfield>atthasmissing</structfield></entry>
1154 <entry><type>bool</type></entry>
1157 This column has a value which is used where the column is entirely
1158 missing from the row, as happens when a column is added with a
1159 non-volatile <literal>DEFAULT</literal> value after the row is created.
1160 The actual value used is stored in the
1161 <structfield>attmissingval</structfield> column.
1166 <entry><structfield>attidentity</structfield></entry>
1167 <entry><type>char</type></entry>
1170 If a zero byte (<literal>''</literal>), then not an identity column.
1171 Otherwise, <literal>a</literal> = generated
1172 always, <literal>d</literal> = generated by default.
1177 <entry><structfield>attisdropped</structfield></entry>
1178 <entry><type>bool</type></entry>
1181 This column has been dropped and is no longer valid. A dropped
1182 column is still physically present in the table, but is
1183 ignored by the parser and so cannot be accessed via SQL.
1188 <entry><structfield>attislocal</structfield></entry>
1189 <entry><type>bool</type></entry>
1192 This column is defined locally in the relation. Note that a column can
1193 be locally defined and inherited simultaneously.
1198 <entry><structfield>attinhcount</structfield></entry>
1199 <entry><type>int4</type></entry>
1202 The number of direct ancestors this column has. A column with a
1203 nonzero number of ancestors cannot be dropped nor renamed.
1208 <entry><structfield>attcollation</structfield></entry>
1209 <entry><type>oid</type></entry>
1210 <entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
1212 The defined collation of the column, or zero if the column is
1213 not of a collatable data type.
1218 <entry><structfield>attacl</structfield></entry>
1219 <entry><type>aclitem[]</type></entry>
1222 Column-level access privileges, if any have been granted specifically
1228 <entry><structfield>attoptions</structfield></entry>
1229 <entry><type>text[]</type></entry>
1232 Attribute-level options, as <quote>keyword=value</quote> strings
1237 <entry><structfield>attfdwoptions</structfield></entry>
1238 <entry><type>text[]</type></entry>
1241 Attribute-level foreign data wrapper options, as <quote>keyword=value</quote> strings
1246 <entry><structfield>attmissingval</structfield></entry>
1247 <entry><type>anyarray</type></entry>
1250 This column has a one element array containing the value used when the
1251 column is entirely missing from the row, as happens when the column is
1252 added with a non-volatile <literal>DEFAULT</literal> value after the
1253 row is created. The value is only used when
1254 <structfield>atthasmissing</structfield> is true. If there is no value
1264 In a dropped column's <structname>pg_attribute</structname> entry,
1265 <structfield>atttypid</structfield> is reset to zero, but
1266 <structfield>attlen</structfield> and the other fields copied from
1267 <structname>pg_type</structname> are still valid. This arrangement is needed
1268 to cope with the situation where the dropped column's data type was
1269 later dropped, and so there is no <structname>pg_type</structname> row anymore.
1270 <structfield>attlen</structfield> and the other fields can be used
1271 to interpret the contents of a row of the table.
1276 <sect1 id="catalog-pg-authid">
1277 <title><structname>pg_authid</structname></title>
1279 <indexterm zone="catalog-pg-authid">
1280 <primary>pg_authid</primary>
1284 The catalog <structname>pg_authid</structname> contains information about
1285 database authorization identifiers (roles). A role subsumes the concepts
1286 of <quote>users</quote> and <quote>groups</quote>. A user is essentially just a
1287 role with the <structfield>rolcanlogin</structfield> flag set. Any role (with or
1288 without <structfield>rolcanlogin</structfield>) can have other roles as members; see
1289 <link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>.
1293 Since this catalog contains passwords, it must not be publicly readable.
1294 <link linkend="view-pg-roles"><structname>pg_roles</structname></link>
1295 is a publicly readable view on
1296 <structname>pg_authid</structname> that blanks out the password field.
1300 <xref linkend="user-manag"/> contains detailed information about user and
1301 privilege management.
1305 Because user identities are cluster-wide,
1306 <structname>pg_authid</structname>
1307 is shared across all databases of a cluster: there is only one
1308 copy of <structname>pg_authid</structname> per cluster, not
1313 <title><structname>pg_authid</structname> Columns</title>
1320 <entry>Description</entry>
1327 <entry><structfield>oid</structfield></entry>
1328 <entry><type>oid</type></entry>
1329 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
1333 <entry><structfield>rolname</structfield></entry>
1334 <entry><type>name</type></entry>
1335 <entry>Role name</entry>
1339 <entry><structfield>rolsuper</structfield></entry>
1340 <entry><type>bool</type></entry>
1341 <entry>Role has superuser privileges</entry>
1345 <entry><structfield>rolinherit</structfield></entry>
1346 <entry><type>bool</type></entry>
1347 <entry>Role automatically inherits privileges of roles it is a
1352 <entry><structfield>rolcreaterole</structfield></entry>
1353 <entry><type>bool</type></entry>
1354 <entry>Role can create more roles</entry>
1358 <entry><structfield>rolcreatedb</structfield></entry>
1359 <entry><type>bool</type></entry>
1360 <entry>Role can create databases</entry>
1364 <entry><structfield>rolcanlogin</structfield></entry>
1365 <entry><type>bool</type></entry>
1367 Role can log in. That is, this role can be given as the initial
1368 session authorization identifier
1373 <entry><structfield>rolreplication</structfield></entry>
1374 <entry><type>bool</type></entry>
1376 Role is a replication role. A replication role can initiate replication
1377 connections and create and drop replication slots.
1382 <entry><structfield>rolbypassrls</structfield></entry>
1383 <entry><type>bool</type></entry>
1385 Role bypasses every row level security policy, see
1386 <xref linkend="ddl-rowsecurity"/> for more information.
1391 <entry><structfield>rolconnlimit</structfield></entry>
1392 <entry><type>int4</type></entry>
1394 For roles that can log in, this sets maximum number of concurrent
1395 connections this role can make. -1 means no limit.
1400 <entry><structfield>rolpassword</structfield></entry>
1401 <entry><type>text</type></entry>
1403 Password (possibly encrypted); null if none. The format depends
1404 on the form of encryption used.
1409 <entry><structfield>rolvaliduntil</structfield></entry>
1410 <entry><type>timestamptz</type></entry>
1411 <entry>Password expiry time (only used for password authentication);
1412 null if no expiration</entry>
1419 For an MD5 encrypted password, <structfield>rolpassword</structfield>
1420 column will begin with the string <literal>md5</literal> followed by a
1421 32-character hexadecimal MD5 hash. The MD5 hash will be of the user's
1422 password concatenated to their user name. For example, if user
1423 <literal>joe</literal> has password <literal>xyzzy</literal>, <productname>PostgreSQL</productname>
1424 will store the md5 hash of <literal>xyzzyjoe</literal>.
1428 If the password is encrypted with SCRAM-SHA-256, it has the format:
1430 SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable><salt></replaceable>$<replaceable><StoredKey></replaceable>:<replaceable><ServerKey></replaceable>
1432 where <replaceable>salt</replaceable>, <replaceable>StoredKey</replaceable> and
1433 <replaceable>ServerKey</replaceable> are in Base64 encoded format. This format is
1434 the same as that specified by RFC 5803.
1438 A password that does not follow either of those formats is assumed to be
1444 <sect1 id="catalog-pg-auth-members">
1445 <title><structname>pg_auth_members</structname></title>
1447 <indexterm zone="catalog-pg-auth-members">
1448 <primary>pg_auth_members</primary>
1452 The catalog <structname>pg_auth_members</structname> shows the membership
1453 relations between roles. Any non-circular set of relationships is allowed.
1457 Because user identities are cluster-wide,
1458 <structname>pg_auth_members</structname>
1459 is shared across all databases of a cluster: there is only one
1460 copy of <structname>pg_auth_members</structname> per cluster, not
1465 <title><structname>pg_auth_members</structname> Columns</title>
1472 <entry>References</entry>
1473 <entry>Description</entry>
1479 <entry><structfield>roleid</structfield></entry>
1480 <entry><type>oid</type></entry>
1481 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
1482 <entry>ID of a role that has a member</entry>
1486 <entry><structfield>member</structfield></entry>
1487 <entry><type>oid</type></entry>
1488 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
1489 <entry>ID of a role that is a member of <structfield>roleid</structfield></entry>
1493 <entry><structfield>grantor</structfield></entry>
1494 <entry><type>oid</type></entry>
1495 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
1496 <entry>ID of the role that granted this membership</entry>
1500 <entry><structfield>admin_option</structfield></entry>
1501 <entry><type>bool</type></entry>
1503 <entry>True if <structfield>member</structfield> can grant membership in
1504 <structfield>roleid</structfield> to others</entry>
1513 <sect1 id="catalog-pg-cast">
1514 <title><structname>pg_cast</structname></title>
1516 <indexterm zone="catalog-pg-cast">
1517 <primary>pg_cast</primary>
1521 The catalog <structname>pg_cast</structname> stores data type conversion
1522 paths, both built-in and user-defined.
1526 It should be noted that <structname>pg_cast</structname> does not represent
1527 every type conversion that the system knows how to perform; only those that
1528 cannot be deduced from some generic rule. For example, casting between a
1529 domain and its base type is not explicitly represented in
1530 <structname>pg_cast</structname>. Another important exception is that
1531 <quote>automatic I/O conversion casts</quote>, those performed using a data
1532 type's own I/O functions to convert to or from <type>text</type> or other
1533 string types, are not explicitly represented in
1534 <structname>pg_cast</structname>.
1538 <title><structname>pg_cast</structname> Columns</title>
1545 <entry>References</entry>
1546 <entry>Description</entry>
1552 <entry><structfield>oid</structfield></entry>
1553 <entry><type>oid</type></entry>
1555 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
1559 <entry><structfield>castsource</structfield></entry>
1560 <entry><type>oid</type></entry>
1561 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
1562 <entry>OID of the source data type</entry>
1566 <entry><structfield>casttarget</structfield></entry>
1567 <entry><type>oid</type></entry>
1568 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
1569 <entry>OID of the target data type</entry>
1573 <entry><structfield>castfunc</structfield></entry>
1574 <entry><type>oid</type></entry>
1575 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
1577 The OID of the function to use to perform this cast. Zero is
1578 stored if the cast method doesn't require a function.
1583 <entry><structfield>castcontext</structfield></entry>
1584 <entry><type>char</type></entry>
1587 Indicates what contexts the cast can be invoked in.
1588 <literal>e</literal> means only as an explicit cast (using
1589 <literal>CAST</literal> or <literal>::</literal> syntax).
1590 <literal>a</literal> means implicitly in assignment
1591 to a target column, as well as explicitly.
1592 <literal>i</literal> means implicitly in expressions, as well as the
1597 <entry><structfield>castmethod</structfield></entry>
1598 <entry><type>char</type></entry>
1601 Indicates how the cast is performed.
1602 <literal>f</literal> means that the function specified in the <structfield>castfunc</structfield> field is used.
1603 <literal>i</literal> means that the input/output functions are used.
1604 <literal>b</literal> means that the types are binary-coercible, thus no conversion is required.
1612 The cast functions listed in <structname>pg_cast</structname> must
1613 always take the cast source type as their first argument type, and
1614 return the cast destination type as their result type. A cast
1615 function can have up to three arguments. The second argument,
1616 if present, must be type <type>integer</type>; it receives the type
1617 modifier associated with the destination type, or -1
1618 if there is none. The third argument,
1619 if present, must be type <type>boolean</type>; it receives <literal>true</literal>
1620 if the cast is an explicit cast, <literal>false</literal> otherwise.
1624 It is legitimate to create a <structname>pg_cast</structname> entry
1625 in which the source and target types are the same, if the associated
1626 function takes more than one argument. Such entries represent
1627 <quote>length coercion functions</quote> that coerce values of the type
1628 to be legal for a particular type modifier value.
1632 When a <structname>pg_cast</structname> entry has different source and
1633 target types and a function that takes more than one argument, it
1634 represents converting from one type to another and applying a length
1635 coercion in a single step. When no such entry is available, coercion
1636 to a type that uses a type modifier involves two steps, one to
1637 convert between data types and a second to apply the modifier.
1641 <sect1 id="catalog-pg-class">
1642 <title><structname>pg_class</structname></title>
1644 <indexterm zone="catalog-pg-class">
1645 <primary>pg_class</primary>
1649 The catalog <structname>pg_class</structname> catalogs tables and most
1650 everything else that has columns or is otherwise similar to a
1651 table. This includes indexes (but see also
1652 <structname>pg_index</structname>), sequences (but see also
1653 <structname>pg_sequence</structname>), views, materialized
1654 views, composite types, and TOAST tables; see <structfield>relkind</structfield>.
1655 Below, when we mean all of these
1656 kinds of objects we speak of <quote>relations</quote>. Not all
1657 columns are meaningful for all relation types.
1661 <title><structname>pg_class</structname> Columns</title>
1668 <entry>References</entry>
1669 <entry>Description</entry>
1675 <entry><structfield>oid</structfield></entry>
1676 <entry><type>oid</type></entry>
1678 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
1682 <entry><structfield>relname</structfield></entry>
1683 <entry><type>name</type></entry>
1685 <entry>Name of the table, index, view, etc.</entry>
1689 <entry><structfield>relnamespace</structfield></entry>
1690 <entry><type>oid</type></entry>
1691 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
1693 The OID of the namespace that contains this relation
1698 <entry><structfield>reltype</structfield></entry>
1699 <entry><type>oid</type></entry>
1700 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
1702 The OID of the data type that corresponds to this table's row type,
1703 if any (zero for indexes, which have no <structname>pg_type</structname> entry)
1708 <entry><structfield>reloftype</structfield></entry>
1709 <entry><type>oid</type></entry>
1710 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
1712 For typed tables, the OID of the underlying composite type,
1713 zero for all other relations
1718 <entry><structfield>relowner</structfield></entry>
1719 <entry><type>oid</type></entry>
1720 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
1721 <entry>Owner of the relation</entry>
1725 <entry><structfield>relam</structfield></entry>
1726 <entry><type>oid</type></entry>
1727 <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
1728 <entry>If this is an index, the access method used (B-tree, hash, etc.)</entry>
1732 <entry><structfield>relfilenode</structfield></entry>
1733 <entry><type>oid</type></entry>
1735 <entry>Name of the on-disk file of this relation; zero means this
1736 is a <quote>mapped</quote> relation whose disk file name is determined
1737 by low-level state</entry>
1741 <entry><structfield>reltablespace</structfield></entry>
1742 <entry><type>oid</type></entry>
1743 <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
1745 The tablespace in which this relation is stored. If zero,
1746 the database's default tablespace is implied. (Not meaningful
1747 if the relation has no on-disk file.)
1752 <entry><structfield>relpages</structfield></entry>
1753 <entry><type>int4</type></entry>
1756 Size of the on-disk representation of this table in pages (of size
1757 <symbol>BLCKSZ</symbol>). This is only an estimate used by the
1758 planner. It is updated by <command>VACUUM</command>,
1759 <command>ANALYZE</command>, and a few DDL commands such as
1760 <command>CREATE INDEX</command>.
1765 <entry><structfield>reltuples</structfield></entry>
1766 <entry><type>float4</type></entry>
1769 Number of live rows in the table. This is only an estimate used by
1770 the planner. It is updated by <command>VACUUM</command>,
1771 <command>ANALYZE</command>, and a few DDL commands such as
1772 <command>CREATE INDEX</command>.
1777 <entry><structfield>relallvisible</structfield></entry>
1778 <entry><type>int4</type></entry>
1781 Number of pages that are marked all-visible in the table's
1782 visibility map. This is only an estimate used by the
1783 planner. It is updated by <command>VACUUM</command>,
1784 <command>ANALYZE</command>, and a few DDL commands such as
1785 <command>CREATE INDEX</command>.
1790 <entry><structfield>reltoastrelid</structfield></entry>
1791 <entry><type>oid</type></entry>
1792 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
1794 OID of the TOAST table associated with this table, 0 if none. The
1795 TOAST table stores large attributes <quote>out of line</quote> in a
1801 <entry><structfield>relhasindex</structfield></entry>
1802 <entry><type>bool</type></entry>
1805 True if this is a table and it has (or recently had) any indexes
1810 <entry><structfield>relisshared</structfield></entry>
1811 <entry><type>bool</type></entry>
1814 True if this table is shared across all databases in the cluster. Only
1815 certain system catalogs (such as <structname>pg_database</structname>)
1821 <entry><structfield>relpersistence</structfield></entry>
1822 <entry><type>char</type></entry>
1825 <literal>p</literal> = permanent table, <literal>u</literal> = unlogged table,
1826 <literal>t</literal> = temporary table
1831 <entry><structfield>relkind</structfield></entry>
1832 <entry><type>char</type></entry>
1835 <literal>r</literal> = ordinary table,
1836 <literal>i</literal> = index,
1837 <literal>S</literal> = sequence,
1838 <literal>t</literal> = TOAST table,
1839 <literal>v</literal> = view,
1840 <literal>m</literal> = materialized view,
1841 <literal>c</literal> = composite type,
1842 <literal>f</literal> = foreign table,
1843 <literal>p</literal> = partitioned table
1848 <entry><structfield>relnatts</structfield></entry>
1849 <entry><type>int2</type></entry>
1852 Number of user columns in the relation (system columns not
1853 counted). There must be this many corresponding entries in
1854 <structname>pg_attribute</structname>. See also
1855 <literal>pg_attribute.attnum</literal>.
1860 <entry><structfield>relchecks</structfield></entry>
1861 <entry><type>int2</type></entry>
1864 Number of <literal>CHECK</literal> constraints on the table; see
1865 <link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link> catalog
1870 <entry><structfield>relhasoids</structfield></entry>
1871 <entry><type>bool</type></entry>
1874 True if we generate an OID for each row of the relation
1879 <entry><structfield>relhasrules</structfield></entry>
1880 <entry><type>bool</type></entry>
1883 True if table has (or once had) rules; see
1884 <link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
1889 <entry><structfield>relhastriggers</structfield></entry>
1890 <entry><type>bool</type></entry>
1893 True if table has (or once had) triggers; see
1894 <link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
1899 <entry><structfield>relhassubclass</structfield></entry>
1900 <entry><type>bool</type></entry>
1902 <entry>True if table has (or once had) any inheritance children</entry>
1906 <entry><structfield>relrowsecurity</structfield></entry>
1907 <entry><type>bool</type></entry>
1910 True if table has row level security enabled; see
1911 <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
1916 <entry><structfield>relforcerowsecurity</structfield></entry>
1917 <entry><type>bool</type></entry>
1920 True if row level security (when enabled) will also apply to table owner; see
1921 <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
1926 <entry><structfield>relispopulated</structfield></entry>
1927 <entry><type>bool</type></entry>
1929 <entry>True if relation is populated (this is true for all
1930 relations other than some materialized views)</entry>
1934 <entry><structfield>relreplident</structfield></entry>
1935 <entry><type>char</type></entry>
1938 Columns used to form <quote>replica identity</quote> for rows:
1939 <literal>d</literal> = default (primary key, if any),
1940 <literal>n</literal> = nothing,
1941 <literal>f</literal> = all columns
1942 <literal>i</literal> = index with <structfield>indisreplident</structfield> set, or default
1947 <entry><structfield>relispartition</structfield></entry>
1948 <entry><type>bool</type></entry>
1950 <entry>True if table is a partition</entry>
1954 <entry><structfield>relrewrite</structfield></entry>
1955 <entry><type>oid</type></entry>
1956 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
1958 For new relations being written during a DDL operation that requires a
1959 table rewrite, this contains the OID of the original relation;
1960 otherwise 0. That state is only visible internally; this field should
1961 never contain anything other than 0 for a user-visible relation.
1966 <entry><structfield>relfrozenxid</structfield></entry>
1967 <entry><type>xid</type></entry>
1970 All transaction IDs before this one have been replaced with a permanent
1971 (<quote>frozen</quote>) transaction ID in this table. This is used to track
1972 whether the table needs to be vacuumed in order to prevent transaction
1973 ID wraparound or to allow <literal>pg_xact</literal> to be shrunk. Zero
1974 (<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
1979 <entry><structfield>relminmxid</structfield></entry>
1980 <entry><type>xid</type></entry>
1983 All multixact IDs before this one have been replaced by a
1984 transaction ID in this table. This is used to track
1985 whether the table needs to be vacuumed in order to prevent multixact ID
1986 wraparound or to allow <literal>pg_multixact</literal> to be shrunk. Zero
1987 (<symbol>InvalidMultiXactId</symbol>) if the relation is not a table.
1992 <entry><structfield>relacl</structfield></entry>
1993 <entry><type>aclitem[]</type></entry>
1996 Access privileges; see
1997 <xref linkend="sql-grant"/> and
1998 <xref linkend="sql-revoke"/>
2004 <entry><structfield>reloptions</structfield></entry>
2005 <entry><type>text[]</type></entry>
2008 Access-method-specific options, as <quote>keyword=value</quote> strings
2013 <entry><structfield>relpartbound</structfield></entry>
2014 <entry><type>pg_node_tree</type></entry>
2017 If table is a partition (see <structfield>relispartition</structfield>),
2018 internal representation of the partition bound
2026 Several of the Boolean flags in <structname>pg_class</structname> are maintained
2027 lazily: they are guaranteed to be true if that's the correct state, but
2028 may not be reset to false immediately when the condition is no longer
2029 true. For example, <structfield>relhasindex</structfield> is set by
2030 <command>CREATE INDEX</command>, but it is never cleared by
2031 <command>DROP INDEX</command>. Instead, <command>VACUUM</command> clears
2032 <structfield>relhasindex</structfield> if it finds the table has no indexes. This
2033 arrangement avoids race conditions and improves concurrency.
2037 <sect1 id="catalog-pg-collation">
2038 <title><structname>pg_collation</structname></title>
2040 <indexterm zone="catalog-pg-collation">
2041 <primary>pg_collation</primary>
2045 The catalog <structname>pg_collation</structname> describes the
2046 available collations, which are essentially mappings from an SQL
2047 name to operating system locale categories.
2048 See <xref linkend="collation"/> for more information.
2052 <title><structname>pg_collation</structname> Columns</title>
2059 <entry>References</entry>
2060 <entry>Description</entry>
2066 <entry><structfield>oid</structfield></entry>
2067 <entry><type>oid</type></entry>
2069 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
2073 <entry><structfield>collname</structfield></entry>
2074 <entry><type>name</type></entry>
2076 <entry>Collation name (unique per namespace and encoding)</entry>
2080 <entry><structfield>collnamespace</structfield></entry>
2081 <entry><type>oid</type></entry>
2082 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
2084 The OID of the namespace that contains this collation
2089 <entry><structfield>collowner</structfield></entry>
2090 <entry><type>oid</type></entry>
2091 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
2092 <entry>Owner of the collation</entry>
2096 <entry><structfield>collprovider</structfield></entry>
2097 <entry><type>char</type></entry>
2099 <entry>Provider of the collation: <literal>d</literal> = database
2100 default, <literal>c</literal> = libc, <literal>i</literal> = icu</entry>
2104 <entry><structfield>collencoding</structfield></entry>
2105 <entry><type>int4</type></entry>
2107 <entry>Encoding in which the collation is applicable, or -1 if it
2108 works for any encoding</entry>
2112 <entry><structfield>collcollate</structfield></entry>
2113 <entry><type>name</type></entry>
2115 <entry><symbol>LC_COLLATE</symbol> for this collation object</entry>
2119 <entry><structfield>collctype</structfield></entry>
2120 <entry><type>name</type></entry>
2122 <entry><symbol>LC_CTYPE</symbol> for this collation object</entry>
2126 <entry><structfield>collversion</structfield></entry>
2127 <entry><type>text</type></entry>
2130 Provider-specific version of the collation. This is recorded when the
2131 collation is created and then checked when it is used, to detect
2132 changes in the collation definition that could lead to data corruption.
2140 Note that the unique key on this catalog is (<structfield>collname</structfield>,
2141 <structfield>collencoding</structfield>, <structfield>collnamespace</structfield>) not just
2142 (<structfield>collname</structfield>, <structfield>collnamespace</structfield>).
2143 <productname>PostgreSQL</productname> generally ignores all
2144 collations that do not have <structfield>collencoding</structfield> equal to
2145 either the current database's encoding or -1, and creation of new entries
2146 with the same name as an entry with <structfield>collencoding</structfield> = -1
2147 is forbidden. Therefore it is sufficient to use a qualified SQL name
2148 (<replaceable>schema</replaceable>.<replaceable>name</replaceable>) to identify a collation,
2149 even though this is not unique according to the catalog definition.
2150 The reason for defining the catalog this way is that
2151 <application>initdb</application> fills it in at cluster initialization time with
2152 entries for all locales available on the system, so it must be able to
2153 hold entries for all encodings that might ever be used in the cluster.
2157 In the <literal>template0</literal> database, it could be useful to create
2158 collations whose encoding does not match the database encoding,
2159 since they could match the encodings of databases later cloned from
2160 <literal>template0</literal>. This would currently have to be done manually.
2164 <sect1 id="catalog-pg-constraint">
2165 <title><structname>pg_constraint</structname></title>
2167 <indexterm zone="catalog-pg-constraint">
2168 <primary>pg_constraint</primary>
2172 The catalog <structname>pg_constraint</structname> stores check, primary
2173 key, unique, foreign key, and exclusion constraints on tables.
2174 (Column constraints are not treated specially. Every column constraint is
2175 equivalent to some table constraint.)
2176 Not-null constraints are represented in the <structname>pg_attribute</structname>
2181 User-defined constraint triggers (created with <command>CREATE CONSTRAINT
2182 TRIGGER</command>) also give rise to an entry in this table.
2186 Check constraints on domains are stored here, too.
2190 <title><structname>pg_constraint</structname> Columns</title>
2197 <entry>References</entry>
2198 <entry>Description</entry>
2204 <entry><structfield>oid</structfield></entry>
2205 <entry><type>oid</type></entry>
2207 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
2211 <entry><structfield>conname</structfield></entry>
2212 <entry><type>name</type></entry>
2214 <entry>Constraint name (not necessarily unique!)</entry>
2218 <entry><structfield>connamespace</structfield></entry>
2219 <entry><type>oid</type></entry>
2220 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
2222 The OID of the namespace that contains this constraint
2227 <entry><structfield>contype</structfield></entry>
2228 <entry><type>char</type></entry>
2231 <literal>c</literal> = check constraint,
2232 <literal>f</literal> = foreign key constraint,
2233 <literal>p</literal> = primary key constraint,
2234 <literal>u</literal> = unique constraint,
2235 <literal>t</literal> = constraint trigger,
2236 <literal>x</literal> = exclusion constraint
2241 <entry><structfield>condeferrable</structfield></entry>
2242 <entry><type>bool</type></entry>
2244 <entry>Is the constraint deferrable?</entry>
2248 <entry><structfield>condeferred</structfield></entry>
2249 <entry><type>bool</type></entry>
2251 <entry>Is the constraint deferred by default?</entry>
2255 <entry><structfield>convalidated</structfield></entry>
2256 <entry><type>bool</type></entry>
2258 <entry>Has the constraint been validated?
2259 Currently, can only be false for foreign keys and CHECK constraints</entry>
2263 <entry><structfield>conrelid</structfield></entry>
2264 <entry><type>oid</type></entry>
2265 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
2266 <entry>The table this constraint is on; 0 if not a table constraint</entry>
2270 <entry><structfield>contypid</structfield></entry>
2271 <entry><type>oid</type></entry>
2272 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
2273 <entry>The domain this constraint is on; 0 if not a domain constraint</entry>
2277 <entry><structfield>conindid</structfield></entry>
2278 <entry><type>oid</type></entry>
2279 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
2280 <entry>The index supporting this constraint, if it's a unique, primary
2281 key, foreign key, or exclusion constraint; else 0</entry>
2285 <entry><structfield>conparentid</structfield></entry>
2286 <entry><type>oid</type></entry>
2287 <entry><literal><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.oid</literal></entry>
2288 <entry>The corresponding constraint in the parent partitioned table,
2289 if this is a constraint in a partition; else 0</entry>
2293 <entry><structfield>confrelid</structfield></entry>
2294 <entry><type>oid</type></entry>
2295 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
2296 <entry>If a foreign key, the referenced table; else 0</entry>
2300 <entry><structfield>confupdtype</structfield></entry>
2301 <entry><type>char</type></entry>
2303 <entry>Foreign key update action code:
2304 <literal>a</literal> = no action,
2305 <literal>r</literal> = restrict,
2306 <literal>c</literal> = cascade,
2307 <literal>n</literal> = set null,
2308 <literal>d</literal> = set default
2313 <entry><structfield>confdeltype</structfield></entry>
2314 <entry><type>char</type></entry>
2316 <entry>Foreign key deletion action code:
2317 <literal>a</literal> = no action,
2318 <literal>r</literal> = restrict,
2319 <literal>c</literal> = cascade,
2320 <literal>n</literal> = set null,
2321 <literal>d</literal> = set default
2326 <entry><structfield>confmatchtype</structfield></entry>
2327 <entry><type>char</type></entry>
2329 <entry>Foreign key match type:
2330 <literal>f</literal> = full,
2331 <literal>p</literal> = partial,
2332 <literal>s</literal> = simple
2337 <entry><structfield>conislocal</structfield></entry>
2338 <entry><type>bool</type></entry>
2341 This constraint is defined locally for the relation. Note that a
2342 constraint can be locally defined and inherited simultaneously.
2347 <entry><structfield>coninhcount</structfield></entry>
2348 <entry><type>int4</type></entry>
2351 The number of direct inheritance ancestors this constraint has.
2353 a nonzero number of ancestors cannot be dropped nor renamed.
2358 <entry><structfield>connoinherit</structfield></entry>
2359 <entry><type>bool</type></entry>
2362 This constraint is defined locally for the relation. It is a
2363 non-inheritable constraint.
2368 <entry><structfield>conkey</structfield></entry>
2369 <entry><type>int2[]</type></entry>
2370 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
2371 <entry>If a table constraint (including foreign keys, but not constraint
2372 triggers), list of the constrained columns</entry>
2376 <entry><structfield>confkey</structfield></entry>
2377 <entry><type>int2[]</type></entry>
2378 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
2379 <entry>If a foreign key, list of the referenced columns</entry>
2383 <entry><structfield>conpfeqop</structfield></entry>
2384 <entry><type>oid[]</type></entry>
2385 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
2386 <entry>If a foreign key, list of the equality operators for PK = FK comparisons</entry>
2390 <entry><structfield>conppeqop</structfield></entry>
2391 <entry><type>oid[]</type></entry>
2392 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
2393 <entry>If a foreign key, list of the equality operators for PK = PK comparisons</entry>
2397 <entry><structfield>conffeqop</structfield></entry>
2398 <entry><type>oid[]</type></entry>
2399 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
2400 <entry>If a foreign key, list of the equality operators for FK = FK comparisons</entry>
2404 <entry><structfield>conexclop</structfield></entry>
2405 <entry><type>oid[]</type></entry>
2406 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
2407 <entry>If an exclusion constraint, list of the per-column exclusion operators</entry>
2411 <entry><structfield>conbin</structfield></entry>
2412 <entry><type>pg_node_tree</type></entry>
2414 <entry>If a check constraint, an internal representation of the expression</entry>
2418 <entry><structfield>consrc</structfield></entry>
2419 <entry><type>text</type></entry>
2421 <entry>If a check constraint, a human-readable representation of the expression</entry>
2428 In the case of an exclusion constraint, <structfield>conkey</structfield>
2429 is only useful for constraint elements that are simple column references.
2430 For other cases, a zero appears in <structfield>conkey</structfield>
2431 and the associated index must be consulted to discover the expression
2432 that is constrained. (<structfield>conkey</structfield> thus has the
2433 same contents as <structname>pg_index</structname>.<structfield>indkey</structfield> for the
2439 <structfield>consrc</structfield> is not updated when referenced objects
2440 change; for example, it won't track renaming of columns. Rather than
2441 relying on this field, it's best to use <function>pg_get_constraintdef()</function>
2442 to extract the definition of a check constraint.
2448 <literal>pg_class.relchecks</literal> needs to agree with the
2449 number of check-constraint entries found in this table for each
2456 <sect1 id="catalog-pg-conversion">
2457 <title><structname>pg_conversion</structname></title>
2459 <indexterm zone="catalog-pg-conversion">
2460 <primary>pg_conversion</primary>
2464 The catalog <structname>pg_conversion</structname> describes
2465 encoding conversion procedures. See <xref linkend="sql-createconversion"/>
2466 for more information.
2470 <title><structname>pg_conversion</structname> Columns</title>
2477 <entry>References</entry>
2478 <entry>Description</entry>
2484 <entry><structfield>oid</structfield></entry>
2485 <entry><type>oid</type></entry>
2487 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
2491 <entry><structfield>conname</structfield></entry>
2492 <entry><type>name</type></entry>
2494 <entry>Conversion name (unique within a namespace)</entry>
2498 <entry><structfield>connamespace</structfield></entry>
2499 <entry><type>oid</type></entry>
2500 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
2502 The OID of the namespace that contains this conversion
2507 <entry><structfield>conowner</structfield></entry>
2508 <entry><type>oid</type></entry>
2509 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
2510 <entry>Owner of the conversion</entry>
2514 <entry><structfield>conforencoding</structfield></entry>
2515 <entry><type>int4</type></entry>
2517 <entry>Source encoding ID</entry>
2521 <entry><structfield>contoencoding</structfield></entry>
2522 <entry><type>int4</type></entry>
2524 <entry>Destination encoding ID</entry>
2528 <entry><structfield>conproc</structfield></entry>
2529 <entry><type>regproc</type></entry>
2530 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
2531 <entry>Conversion procedure</entry>
2535 <entry><structfield>condefault</structfield></entry>
2536 <entry><type>bool</type></entry>
2538 <entry>True if this is the default conversion</entry>
2547 <sect1 id="catalog-pg-database">
2548 <title><structname>pg_database</structname></title>
2550 <indexterm zone="catalog-pg-database">
2551 <primary>pg_database</primary>
2555 The catalog <structname>pg_database</structname> stores information about
2556 the available databases. Databases are created with the <xref
2557 linkend="sql-createdatabase"/> command.
2558 Consult <xref linkend="managing-databases"/> for details about the meaning
2559 of some of the parameters.
2563 Unlike most system catalogs, <structname>pg_database</structname>
2564 is shared across all databases of a cluster: there is only one
2565 copy of <structname>pg_database</structname> per cluster, not
2570 <title><structname>pg_database</structname> Columns</title>
2577 <entry>References</entry>
2578 <entry>Description</entry>
2584 <entry><structfield>oid</structfield></entry>
2585 <entry><type>oid</type></entry>
2587 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
2591 <entry><structfield>datname</structfield></entry>
2592 <entry><type>name</type></entry>
2594 <entry>Database name</entry>
2598 <entry><structfield>datdba</structfield></entry>
2599 <entry><type>oid</type></entry>
2600 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
2601 <entry>Owner of the database, usually the user who created it</entry>
2605 <entry><structfield>encoding</structfield></entry>
2606 <entry><type>int4</type></entry>
2608 <entry>Character encoding for this database
2609 (<function>pg_encoding_to_char()</function> can translate
2610 this number to the encoding name)</entry>
2614 <entry><structfield>datcollate</structfield></entry>
2615 <entry><type>name</type></entry>
2617 <entry>LC_COLLATE for this database</entry>
2621 <entry><structfield>datctype</structfield></entry>
2622 <entry><type>name</type></entry>
2624 <entry>LC_CTYPE for this database</entry>
2628 <entry><structfield>datistemplate</structfield></entry>
2629 <entry><type>bool</type></entry>
2632 If true, then this database can be cloned by
2633 any user with <literal>CREATEDB</literal> privileges;
2634 if false, then only superusers or the owner of
2635 the database can clone it.
2640 <entry><structfield>datallowconn</structfield></entry>
2641 <entry><type>bool</type></entry>
2644 If false then no one can connect to this database. This is
2645 used to protect the <literal>template0</literal> database from being altered.
2650 <entry><structfield>datconnlimit</structfield></entry>
2651 <entry><type>int4</type></entry>
2654 Sets maximum number of concurrent connections that can be made
2655 to this database. -1 means no limit.
2660 <entry><structfield>datlastsysoid</structfield></entry>
2661 <entry><type>oid</type></entry>
2664 Last system OID in the database; useful
2665 particularly to <application>pg_dump</application>
2670 <entry><structfield>datfrozenxid</structfield></entry>
2671 <entry><type>xid</type></entry>
2674 All transaction IDs before this one have been replaced with a permanent
2675 (<quote>frozen</quote>) transaction ID in this database. This is used to
2676 track whether the database needs to be vacuumed in order to prevent
2677 transaction ID wraparound or to allow <literal>pg_xact</literal> to be shrunk.
2678 It is the minimum of the per-table
2679 <structname>pg_class</structname>.<structfield>relfrozenxid</structfield> values.
2684 <entry><structfield>datminmxid</structfield></entry>
2685 <entry><type>xid</type></entry>
2688 All multixact IDs before this one have been replaced with a
2689 transaction ID in this database. This is used to
2690 track whether the database needs to be vacuumed in order to prevent
2691 multixact ID wraparound or to allow <literal>pg_multixact</literal> to be shrunk.
2692 It is the minimum of the per-table
2693 <structname>pg_class</structname>.<structfield>relminmxid</structfield> values.
2698 <entry><structfield>dattablespace</structfield></entry>
2699 <entry><type>oid</type></entry>
2700 <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
2702 The default tablespace for the database.
2703 Within this database, all tables for which
2704 <structname>pg_class</structname>.<structfield>reltablespace</structfield> is zero
2705 will be stored in this tablespace; in particular, all the non-shared
2706 system catalogs will be there.
2711 <entry><structfield>datacl</structfield></entry>
2712 <entry><type>aclitem[]</type></entry>
2715 Access privileges; see
2716 <xref linkend="sql-grant"/> and
2717 <xref linkend="sql-revoke"/>
2727 <sect1 id="catalog-pg-db-role-setting">
2728 <title><structname>pg_db_role_setting</structname></title>
2730 <indexterm zone="catalog-pg-db-role-setting">
2731 <primary>pg_db_role_setting</primary>
2735 The catalog <structname>pg_db_role_setting</structname> records the default
2736 values that have been set for run-time configuration variables,
2737 for each role and database combination.
2741 Unlike most system catalogs, <structname>pg_db_role_setting</structname>
2742 is shared across all databases of a cluster: there is only one
2743 copy of <structname>pg_db_role_setting</structname> per cluster, not
2748 <title><structname>pg_db_role_setting</structname> Columns</title>
2755 <entry>References</entry>
2756 <entry>Description</entry>
2762 <entry><structfield>setdatabase</structfield></entry>
2763 <entry><type>oid</type></entry>
2764 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
2765 <entry>The OID of the database the setting is applicable to, or zero if not database-specific</entry>
2769 <entry><structfield>setrole</structfield></entry>
2770 <entry><type>oid</type></entry>
2771 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
2772 <entry>The OID of the role the setting is applicable to, or zero if not role-specific</entry>
2776 <entry><structfield>setconfig</structfield></entry>
2777 <entry><type>text[]</type></entry>
2779 <entry>Defaults for run-time configuration variables</entry>
2787 <sect1 id="catalog-pg-default-acl">
2788 <title><structname>pg_default_acl</structname></title>
2790 <indexterm zone="catalog-pg-default-acl">
2791 <primary>pg_default_acl</primary>
2795 The catalog <structname>pg_default_acl</structname> stores initial
2796 privileges to be assigned to newly created objects.
2800 <title><structname>pg_default_acl</structname> Columns</title>
2807 <entry>References</entry>
2808 <entry>Description</entry>
2814 <entry><structfield>oid</structfield></entry>
2815 <entry><type>oid</type></entry>
2817 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
2821 <entry><structfield>defaclrole</structfield></entry>
2822 <entry><type>oid</type></entry>
2823 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
2824 <entry>The OID of the role associated with this entry</entry>
2828 <entry><structfield>defaclnamespace</structfield></entry>
2829 <entry><type>oid</type></entry>
2830 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
2831 <entry>The OID of the namespace associated with this entry,
2832 or 0 if none</entry>
2836 <entry><structfield>defaclobjtype</structfield></entry>
2837 <entry><type>char</type></entry>
2840 Type of object this entry is for:
2841 <literal>r</literal> = relation (table, view),
2842 <literal>S</literal> = sequence,
2843 <literal>f</literal> = function,
2844 <literal>T</literal> = type
2849 <entry><structfield>defaclacl</structfield></entry>
2850 <entry><type>aclitem[]</type></entry>
2853 Access privileges that this type of object should have on creation
2861 A <structname>pg_default_acl</structname> entry shows the initial privileges to
2862 be assigned to an object belonging to the indicated user. There are
2863 currently two types of entry: <quote>global</quote> entries with
2864 <structfield>defaclnamespace</structfield> = 0, and <quote>per-schema</quote> entries
2865 that reference a particular schema. If a global entry is present then
2866 it <emphasis>overrides</emphasis> the normal hard-wired default privileges
2867 for the object type. A per-schema entry, if present, represents privileges
2868 to be <emphasis>added to</emphasis> the global or hard-wired default privileges.
2872 Note that when an ACL entry in another catalog is null, it is taken
2873 to represent the hard-wired default privileges for its object,
2874 <emphasis>not</emphasis> whatever might be in <structname>pg_default_acl</structname>
2875 at the moment. <structname>pg_default_acl</structname> is only consulted during
2882 <sect1 id="catalog-pg-depend">
2883 <title><structname>pg_depend</structname></title>
2885 <indexterm zone="catalog-pg-depend">
2886 <primary>pg_depend</primary>
2890 The catalog <structname>pg_depend</structname> records the dependency
2891 relationships between database objects. This information allows
2892 <command>DROP</command> commands to find which other objects must be dropped
2893 by <command>DROP CASCADE</command> or prevent dropping in the <command>DROP
2894 RESTRICT</command> case.
2898 See also <link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link>,
2899 which performs a similar function for dependencies involving objects
2900 that are shared across a database cluster.
2904 <title><structname>pg_depend</structname> Columns</title>
2911 <entry>References</entry>
2912 <entry>Description</entry>
2918 <entry><structfield>classid</structfield></entry>
2919 <entry><type>oid</type></entry>
2920 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
2921 <entry>The OID of the system catalog the dependent object is in</entry>
2925 <entry><structfield>objid</structfield></entry>
2926 <entry><type>oid</type></entry>
2927 <entry>any OID column</entry>
2928 <entry>The OID of the specific dependent object</entry>
2932 <entry><structfield>objsubid</structfield></entry>
2933 <entry><type>int4</type></entry>
2936 For a table column, this is the column number (the
2937 <structfield>objid</structfield> and <structfield>classid</structfield> refer to the
2938 table itself). For all other object types, this column is
2944 <entry><structfield>refclassid</structfield></entry>
2945 <entry><type>oid</type></entry>
2946 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
2947 <entry>The OID of the system catalog the referenced object is in</entry>
2951 <entry><structfield>refobjid</structfield></entry>
2952 <entry><type>oid</type></entry>
2953 <entry>any OID column</entry>
2954 <entry>The OID of the specific referenced object</entry>
2958 <entry><structfield>refobjsubid</structfield></entry>
2959 <entry><type>int4</type></entry>
2962 For a table column, this is the column number (the
2963 <structfield>refobjid</structfield> and <structfield>refclassid</structfield> refer
2964 to the table itself). For all other object types, this column
2970 <entry><structfield>deptype</structfield></entry>
2971 <entry><type>char</type></entry>
2974 A code defining the specific semantics of this dependency relationship; see text
2983 In all cases, a <structname>pg_depend</structname> entry indicates that the
2984 referenced object cannot be dropped without also dropping the dependent
2985 object. However, there are several subflavors identified by
2986 <structfield>deptype</structfield>:
2990 <term><symbol>DEPENDENCY_NORMAL</symbol> (<literal>n</literal>)</term>
2993 A normal relationship between separately-created objects. The
2994 dependent object can be dropped without affecting the
2995 referenced object. The referenced object can only be dropped
2996 by specifying <literal>CASCADE</literal>, in which case the dependent
2997 object is dropped, too. Example: a table column has a normal
2998 dependency on its data type.
3004 <term><symbol>DEPENDENCY_AUTO</symbol> (<literal>a</literal>)</term>
3007 The dependent object can be dropped separately from the
3008 referenced object, and should be automatically dropped
3009 (regardless of <literal>RESTRICT</literal> or <literal>CASCADE</literal>
3010 mode) if the referenced object is dropped. Example: a named
3011 constraint on a table is made autodependent on the table, so
3012 that it will go away if the table is dropped.
3018 <term><symbol>DEPENDENCY_INTERNAL</symbol> (<literal>i</literal>)</term>
3021 The dependent object was created as part of creation of the
3022 referenced object, and is really just a part of its internal
3023 implementation. A <command>DROP</command> of the dependent object
3024 will be disallowed outright (we'll tell the user to issue a
3025 <command>DROP</command> against the referenced object, instead). A
3026 <command>DROP</command> of the referenced object will be propagated
3027 through to drop the dependent object whether
3028 <command>CASCADE</command> is specified or not. Example: a trigger
3029 that's created to enforce a foreign-key constraint is made
3030 internally dependent on the constraint's
3031 <structname>pg_constraint</structname> entry.
3037 <term><symbol>DEPENDENCY_INTERNAL_AUTO</symbol> (<literal>I</literal>)</term>
3040 The dependent object was created as part of creation of the
3041 referenced object, and is really just a part of its internal
3042 implementation. A <command>DROP</command> of the dependent object
3043 will be disallowed outright (we'll tell the user to issue a
3044 <command>DROP</command> against the referenced object, instead).
3045 While a regular internal dependency will prevent
3046 the dependent object from being dropped while any such dependencies
3047 remain, <literal>DEPENDENCY_INTERNAL_AUTO</literal> will allow such
3048 a drop as long as the object can be found by following any of such
3050 Example: an index on a partition is made internal-auto-dependent on
3051 both the partition itself as well as on the index on the parent
3052 partitioned table; so the partition index is dropped together with
3053 either the partition it indexes, or with the parent index it is
3060 <term><symbol>DEPENDENCY_EXTENSION</symbol> (<literal>e</literal>)</term>
3063 The dependent object is a member of the <firstterm>extension</firstterm> that is
3064 the referenced object (see
3065 <link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>).
3066 The dependent object can be dropped only via
3067 <command>DROP EXTENSION</command> on the referenced object. Functionally
3068 this dependency type acts the same as an internal dependency, but
3069 it's kept separate for clarity and to simplify <application>pg_dump</application>.
3075 <term><symbol>DEPENDENCY_AUTO_EXTENSION</symbol> (<literal>x</literal>)</term>
3078 The dependent object is not a member of the extension that is the
3079 referenced object (and so should not be ignored by pg_dump), but
3080 cannot function without it and should be dropped when the
3081 extension itself is. The dependent object may be dropped on its
3088 <term><symbol>DEPENDENCY_PIN</symbol> (<literal>p</literal>)</term>
3091 There is no dependent object; this type of entry is a signal
3092 that the system itself depends on the referenced object, and so
3093 that object must never be deleted. Entries of this type are
3094 created only by <command>initdb</command>. The columns for the
3095 dependent object contain zeroes.
3101 Other dependency flavors might be needed in future.
3107 <sect1 id="catalog-pg-description">
3108 <title><structname>pg_description</structname></title>
3110 <indexterm zone="catalog-pg-description">
3111 <primary>pg_description</primary>
3115 The catalog <structname>pg_description</structname> stores optional descriptions
3116 (comments) for each database object. Descriptions can be manipulated
3117 with the <xref linkend="sql-comment"/> command and viewed with
3118 <application>psql</application>'s <literal>\d</literal> commands.
3119 Descriptions of many built-in system objects are provided in the initial
3120 contents of <structname>pg_description</structname>.
3124 See also <link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>,
3125 which performs a similar function for descriptions involving objects that
3126 are shared across a database cluster.
3130 <title><structname>pg_description</structname> Columns</title>
3137 <entry>References</entry>
3138 <entry>Description</entry>
3144 <entry><structfield>objoid</structfield></entry>
3145 <entry><type>oid</type></entry>
3146 <entry>any OID column</entry>
3147 <entry>The OID of the object this description pertains to</entry>
3151 <entry><structfield>classoid</structfield></entry>
3152 <entry><type>oid</type></entry>
3153 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3154 <entry>The OID of the system catalog this object appears in</entry>
3158 <entry><structfield>objsubid</structfield></entry>
3159 <entry><type>int4</type></entry>
3162 For a comment on a table column, this is the column number (the
3163 <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to
3164 the table itself). For all other object types, this column is
3170 <entry><structfield>description</structfield></entry>
3171 <entry><type>text</type></entry>
3173 <entry>Arbitrary text that serves as the description of this object</entry>
3182 <sect1 id="catalog-pg-enum">
3183 <title><structname>pg_enum</structname></title>
3185 <indexterm zone="catalog-pg-enum">
3186 <primary>pg_enum</primary>
3190 The <structname>pg_enum</structname> catalog contains entries
3191 showing the values and labels for each enum type. The
3192 internal representation of a given enum value is actually the OID
3193 of its associated row in <structname>pg_enum</structname>.
3197 <title><structname>pg_enum</structname> Columns</title>
3204 <entry>References</entry>
3205 <entry>Description</entry>
3211 <entry><structfield>oid</structfield></entry>
3212 <entry><type>oid</type></entry>
3214 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
3218 <entry><structfield>enumtypid</structfield></entry>
3219 <entry><type>oid</type></entry>
3220 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
3221 <entry>The OID of the <structname>pg_type</structname> entry owning this enum value</entry>
3225 <entry><structfield>enumsortorder</structfield></entry>
3226 <entry><type>float4</type></entry>
3228 <entry>The sort position of this enum value within its enum type</entry>
3232 <entry><structfield>enumlabel</structfield></entry>
3233 <entry><type>name</type></entry>
3235 <entry>The textual label for this enum value</entry>
3242 The OIDs for <structname>pg_enum</structname> rows follow a special
3243 rule: even-numbered OIDs are guaranteed to be ordered in the same way
3244 as the sort ordering of their enum type. That is, if two even OIDs
3245 belong to the same enum type, the smaller OID must have the smaller
3246 <structfield>enumsortorder</structfield> value. Odd-numbered OID values
3247 need bear no relationship to the sort order. This rule allows the
3248 enum comparison routines to avoid catalog lookups in many common cases.
3249 The routines that create and alter enum types attempt to assign even
3250 OIDs to enum values whenever possible.
3254 When an enum type is created, its members are assigned sort-order
3255 positions 1..<replaceable>n</replaceable>. But members added later might be given
3256 negative or fractional values of <structfield>enumsortorder</structfield>.
3257 The only requirement on these values is that they be correctly
3258 ordered and unique within each enum type.
3263 <sect1 id="catalog-pg-event-trigger">
3264 <title><structname>pg_event_trigger</structname></title>
3266 <indexterm zone="catalog-pg-event-trigger">
3267 <primary>pg_event_trigger</primary>
3271 The catalog <structname>pg_event_trigger</structname> stores event triggers.
3272 See <xref linkend="event-triggers"/> for more information.
3276 <title><structname>pg_event_trigger</structname> Columns</title>
3283 <entry>References</entry>
3284 <entry>Description</entry>
3290 <entry><structfield>evtname</structfield></entry>
3291 <entry><type>name</type></entry>
3293 <entry>Trigger name (must be unique)</entry>
3297 <entry><structfield>evtevent</structfield></entry>
3298 <entry><type>name</type></entry>
3300 <entry>Identifies the event for which this trigger fires</entry>
3304 <entry><structfield>evtowner</structfield></entry>
3305 <entry><type>oid</type></entry>
3306 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
3307 <entry>Owner of the event trigger</entry>
3311 <entry><structfield>evtfoid</structfield></entry>
3312 <entry><type>oid</type></entry>
3313 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
3314 <entry>The function to be called</entry>
3318 <entry><structfield>evtenabled</structfield></entry>
3319 <entry><type>char</type></entry>
3322 Controls in which <xref linkend="guc-session-replication-role"/> modes
3323 the event trigger fires.
3324 <literal>O</literal> = trigger fires in <quote>origin</quote> and <quote>local</quote> modes,
3325 <literal>D</literal> = trigger is disabled,
3326 <literal>R</literal> = trigger fires in <quote>replica</quote> mode,
3327 <literal>A</literal> = trigger fires always.
3332 <entry><structfield>evttags</structfield></entry>
3333 <entry><type>text[]</type></entry>
3336 Command tags for which this trigger will fire. If NULL, the firing
3337 of this trigger is not restricted on the basis of the command tag.
3346 <sect1 id="catalog-pg-extension">
3347 <title><structname>pg_extension</structname></title>
3349 <indexterm zone="catalog-pg-extension">
3350 <primary>pg_extension</primary>
3354 The catalog <structname>pg_extension</structname> stores information
3355 about the installed extensions. See <xref linkend="extend-extensions"/>
3356 for details about extensions.
3360 <title><structname>pg_extension</structname> Columns</title>
3367 <entry>References</entry>
3368 <entry>Description</entry>
3374 <entry><structfield>oid</structfield></entry>
3375 <entry><type>oid</type></entry>
3377 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
3381 <entry><structfield>extname</structfield></entry>
3382 <entry><type>name</type></entry>
3384 <entry>Name of the extension</entry>
3388 <entry><structfield>extowner</structfield></entry>
3389 <entry><type>oid</type></entry>
3390 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
3391 <entry>Owner of the extension</entry>
3395 <entry><structfield>extnamespace</structfield></entry>
3396 <entry><type>oid</type></entry>
3397 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
3398 <entry>Schema containing the extension's exported objects</entry>
3402 <entry><structfield>extrelocatable</structfield></entry>
3403 <entry><type>bool</type></entry>
3405 <entry>True if extension can be relocated to another schema</entry>
3409 <entry><structfield>extversion</structfield></entry>
3410 <entry><type>text</type></entry>
3412 <entry>Version name for the extension</entry>
3416 <entry><structfield>extconfig</structfield></entry>
3417 <entry><type>oid[]</type></entry>
3418 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3419 <entry>Array of <type>regclass</type> OIDs for the extension's configuration
3420 table(s), or <literal>NULL</literal> if none</entry>
3424 <entry><structfield>extcondition</structfield></entry>
3425 <entry><type>text[]</type></entry>
3427 <entry>Array of <literal>WHERE</literal>-clause filter conditions for the
3428 extension's configuration table(s), or <literal>NULL</literal> if none</entry>
3436 Note that unlike most catalogs with a <quote>namespace</quote> column,
3437 <structfield>extnamespace</structfield> is not meant to imply
3438 that the extension belongs to that schema. Extension names are never
3439 schema-qualified. Rather, <structfield>extnamespace</structfield>
3440 indicates the schema that contains most or all of the extension's
3441 objects. If <structfield>extrelocatable</structfield> is true, then
3442 this schema must in fact contain all schema-qualifiable objects
3443 belonging to the extension.
3448 <sect1 id="catalog-pg-foreign-data-wrapper">
3449 <title><structname>pg_foreign_data_wrapper</structname></title>
3451 <indexterm zone="catalog-pg-foreign-data-wrapper">
3452 <primary>pg_foreign_data_wrapper</primary>
3456 The catalog <structname>pg_foreign_data_wrapper</structname> stores
3457 foreign-data wrapper definitions. A foreign-data wrapper is the
3458 mechanism by which external data, residing on foreign servers, is
3463 <title><structname>pg_foreign_data_wrapper</structname> Columns</title>
3470 <entry>References</entry>
3471 <entry>Description</entry>
3477 <entry><structfield>oid</structfield></entry>
3478 <entry><type>oid</type></entry>
3480 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
3484 <entry><structfield>fdwname</structfield></entry>
3485 <entry><type>name</type></entry>
3487 <entry>Name of the foreign-data wrapper</entry>
3491 <entry><structfield>fdwowner</structfield></entry>
3492 <entry><type>oid</type></entry>
3493 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
3494 <entry>Owner of the foreign-data wrapper</entry>
3498 <entry><structfield>fdwhandler</structfield></entry>
3499 <entry><type>oid</type></entry>
3500 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
3502 References a handler function that is responsible for
3503 supplying execution routines for the foreign-data wrapper.
3504 Zero if no handler is provided
3509 <entry><structfield>fdwvalidator</structfield></entry>
3510 <entry><type>oid</type></entry>
3511 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
3513 References a validator function that is responsible for
3514 checking the validity of the options given to the
3515 foreign-data wrapper, as well as options for foreign servers and user
3516 mappings using the foreign-data wrapper. Zero if no validator
3522 <entry><structfield>fdwacl</structfield></entry>
3523 <entry><type>aclitem[]</type></entry>
3526 Access privileges; see
3527 <xref linkend="sql-grant"/> and
3528 <xref linkend="sql-revoke"/>
3534 <entry><structfield>fdwoptions</structfield></entry>
3535 <entry><type>text[]</type></entry>
3538 Foreign-data wrapper specific options, as <quote>keyword=value</quote> strings
3547 <sect1 id="catalog-pg-foreign-server">
3548 <title><structname>pg_foreign_server</structname></title>
3550 <indexterm zone="catalog-pg-foreign-server">
3551 <primary>pg_foreign_server</primary>
3555 The catalog <structname>pg_foreign_server</structname> stores
3556 foreign server definitions. A foreign server describes a source
3557 of external data, such as a remote server. Foreign
3558 servers are accessed via foreign-data wrappers.
3562 <title><structname>pg_foreign_server</structname> Columns</title>
3569 <entry>References</entry>
3570 <entry>Description</entry>
3576 <entry><structfield>oid</structfield></entry>
3577 <entry><type>oid</type></entry>
3579 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
3583 <entry><structfield>srvname</structfield></entry>
3584 <entry><type>name</type></entry>
3586 <entry>Name of the foreign server</entry>
3590 <entry><structfield>srvowner</structfield></entry>
3591 <entry><type>oid</type></entry>
3592 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
3593 <entry>Owner of the foreign server</entry>
3597 <entry><structfield>srvfdw</structfield></entry>
3598 <entry><type>oid</type></entry>
3599 <entry><literal><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link>.oid</literal></entry>
3600 <entry>OID of the foreign-data wrapper of this foreign server</entry>
3604 <entry><structfield>srvtype</structfield></entry>
3605 <entry><type>text</type></entry>
3607 <entry>Type of the server (optional)</entry>
3611 <entry><structfield>srvversion</structfield></entry>
3612 <entry><type>text</type></entry>
3614 <entry>Version of the server (optional)</entry>
3618 <entry><structfield>srvacl</structfield></entry>
3619 <entry><type>aclitem[]</type></entry>
3622 Access privileges; see
3623 <xref linkend="sql-grant"/> and
3624 <xref linkend="sql-revoke"/>
3630 <entry><structfield>srvoptions</structfield></entry>
3631 <entry><type>text[]</type></entry>
3634 Foreign server specific options, as <quote>keyword=value</quote> strings
3643 <sect1 id="catalog-pg-foreign-table">
3644 <title><structname>pg_foreign_table</structname></title>
3646 <indexterm zone="catalog-pg-foreign-table">
3647 <primary>pg_foreign_table</primary>
3651 The catalog <structname>pg_foreign_table</structname> contains
3652 auxiliary information about foreign tables. A foreign table is
3653 primarily represented by a <structname>pg_class</structname> entry,
3654 just like a regular table. Its <structname>pg_foreign_table</structname>
3655 entry contains the information that is pertinent only to foreign tables
3656 and not any other kind of relation.
3660 <title><structname>pg_foreign_table</structname> Columns</title>
3667 <entry>References</entry>
3668 <entry>Description</entry>
3674 <entry><structfield>ftrelid</structfield></entry>
3675 <entry><type>oid</type></entry>
3676 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3677 <entry>OID of the <structname>pg_class</structname> entry for this foreign table</entry>
3681 <entry><structfield>ftserver</structfield></entry>
3682 <entry><type>oid</type></entry>
3683 <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
3684 <entry>OID of the foreign server for this foreign table</entry>
3688 <entry><structfield>ftoptions</structfield></entry>
3689 <entry><type>text[]</type></entry>
3692 Foreign table options, as <quote>keyword=value</quote> strings
3701 <sect1 id="catalog-pg-index">
3702 <title><structname>pg_index</structname></title>
3704 <indexterm zone="catalog-pg-index">
3705 <primary>pg_index</primary>
3709 The catalog <structname>pg_index</structname> contains part of the information
3710 about indexes. The rest is mostly in
3711 <structname>pg_class</structname>.
3715 <title><structname>pg_index</structname> Columns</title>
3722 <entry>References</entry>
3723 <entry>Description</entry>
3729 <entry><structfield>indexrelid</structfield></entry>
3730 <entry><type>oid</type></entry>
3731 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3732 <entry>The OID of the <structname>pg_class</structname> entry for this index</entry>
3736 <entry><structfield>indrelid</structfield></entry>
3737 <entry><type>oid</type></entry>
3738 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3739 <entry>The OID of the <structname>pg_class</structname> entry for the table this index is for</entry>
3743 <entry><structfield>indnatts</structfield></entry>
3744 <entry><type>int2</type></entry>
3746 <entry>The number of columns in the index (duplicates
3747 <literal>pg_class.relnatts</literal>)</entry>
3751 <entry><structfield>indisunique</structfield></entry>
3752 <entry><type>bool</type></entry>
3754 <entry>If true, this is a unique index</entry>
3758 <entry><structfield>indisprimary</structfield></entry>
3759 <entry><type>bool</type></entry>
3761 <entry>If true, this index represents the primary key of the table
3762 (<structfield>indisunique</structfield> should always be true when this is true)</entry>
3766 <entry><structfield>indisexclusion</structfield></entry>
3767 <entry><type>bool</type></entry>
3769 <entry>If true, this index supports an exclusion constraint</entry>
3773 <entry><structfield>indimmediate</structfield></entry>
3774 <entry><type>bool</type></entry>
3776 <entry>If true, the uniqueness check is enforced immediately on
3778 (irrelevant if <structfield>indisunique</structfield> is not true)</entry>
3782 <entry><structfield>indisclustered</structfield></entry>
3783 <entry><type>bool</type></entry>
3785 <entry>If true, the table was last clustered on this index</entry>
3789 <entry><structfield>indisvalid</structfield></entry>
3790 <entry><type>bool</type></entry>
3793 If true, the index is currently valid for queries. False means the
3794 index is possibly incomplete: it must still be modified by
3795 <command>INSERT</command>/<command>UPDATE</command> operations, but it cannot safely
3796 be used for queries. If it is unique, the uniqueness property is not
3797 guaranteed true either.
3802 <entry><structfield>indcheckxmin</structfield></entry>
3803 <entry><type>bool</type></entry>
3806 If true, queries must not use the index until the <structfield>xmin</structfield>
3807 of this <structname>pg_index</structname> row is below their <symbol>TransactionXmin</symbol>
3808 event horizon, because the table may contain broken HOT chains with
3809 incompatible rows that they can see
3814 <entry><structfield>indisready</structfield></entry>
3815 <entry><type>bool</type></entry>
3818 If true, the index is currently ready for inserts. False means the
3819 index must be ignored by <command>INSERT</command>/<command>UPDATE</command>
3825 <entry><structfield>indislive</structfield></entry>
3826 <entry><type>bool</type></entry>
3829 If false, the index is in process of being dropped, and should be
3830 ignored for all purposes (including HOT-safety decisions)
3835 <entry><structfield>indisreplident</structfield></entry>
3836 <entry><type>bool</type></entry>
3839 If true this index has been chosen as <quote>replica identity</quote>
3840 using <command>ALTER TABLE ... REPLICA IDENTITY USING INDEX
3846 <entry><structfield>indkey</structfield></entry>
3847 <entry><type>int2vector</type></entry>
3848 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
3850 This is an array of <structfield>indnatts</structfield> values that
3851 indicate which table columns this index indexes. For example a value
3852 of <literal>1 3</literal> would mean that the first and the third table
3853 columns make up the index key. A zero in this array indicates that the
3854 corresponding index attribute is an expression over the table columns,
3855 rather than a simple column reference.
3860 <entry><structfield>indcollation</structfield></entry>
3861 <entry><type>oidvector</type></entry>
3862 <entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
3864 For each column in the index key, this contains the OID of the
3865 collation to use for the index, or zero if the column is not
3866 of a collatable data type.
3871 <entry><structfield>indclass</structfield></entry>
3872 <entry><type>oidvector</type></entry>
3873 <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
3875 For each column in the index key, this contains the OID of
3876 the operator class to use. See
3877 <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
3882 <entry><structfield>indoption</structfield></entry>
3883 <entry><type>int2vector</type></entry>
3886 This is an array of <structfield>indnatts</structfield> values that
3887 store per-column flag bits. The meaning of the bits is defined by
3888 the index's access method.
3893 <entry><structfield>indexprs</structfield></entry>
3894 <entry><type>pg_node_tree</type></entry>
3897 Expression trees (in <function>nodeToString()</function>
3898 representation) for index attributes that are not simple column
3899 references. This is a list with one element for each zero
3900 entry in <structfield>indkey</structfield>. Null if all index attributes
3901 are simple references.
3906 <entry><structfield>indpred</structfield></entry>
3907 <entry><type>pg_node_tree</type></entry>
3910 Expression tree (in <function>nodeToString()</function>
3911 representation) for partial index predicate. Null if not a
3922 <sect1 id="catalog-pg-inherits">
3923 <title><structname>pg_inherits</structname></title>
3925 <indexterm zone="catalog-pg-inherits">
3926 <primary>pg_inherits</primary>
3930 The catalog <structname>pg_inherits</structname> records information about
3931 table inheritance hierarchies. There is one entry for each direct
3932 parent-child table relationship in the database. (Indirect inheritance can be determined
3933 by following chains of entries.)
3937 <title><structname>pg_inherits</structname> Columns</title>
3944 <entry>References</entry>
3945 <entry>Description</entry>
3951 <entry><structfield>inhrelid</structfield></entry>
3952 <entry><type>oid</type></entry>
3953 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3955 The OID of the child table
3960 <entry><structfield>inhparent</structfield></entry>
3961 <entry><type>oid</type></entry>
3962 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
3964 The OID of the parent table
3969 <entry><structfield>inhseqno</structfield></entry>
3970 <entry><type>int4</type></entry>
3973 If there is more than one direct parent for a child table (multiple
3974 inheritance), this number tells the order in which the
3975 inherited columns are to be arranged. The count starts at 1.
3984 <sect1 id="catalog-pg-init-privs">
3985 <title><structname>pg_init_privs</structname></title>
3987 <indexterm zone="catalog-pg-init-privs">
3988 <primary>pg_init_privs</primary>
3992 The catalog <structname>pg_init_privs</structname> records information about
3993 the initial privileges of objects in the system. There is one entry
3994 for each object in the database which has a non-default (non-NULL)
3995 initial set of privileges.
3999 Objects can have initial privileges either by having those privileges set
4000 when the system is initialized (by <application>initdb</application>) or when the
4001 object is created during a <command>CREATE EXTENSION</command> and the
4002 extension script sets initial privileges using the <command>GRANT</command>
4003 system. Note that the system will automatically handle recording of the
4004 privileges during the extension script and that extension authors need
4005 only use the <command>GRANT</command> and <command>REVOKE</command>
4006 statements in their script to have the privileges recorded. The
4007 <literal>privtype</literal> column indicates if the initial privilege was
4008 set by <application>initdb</application> or during a
4009 <command>CREATE EXTENSION</command> command.
4013 Objects which have initial privileges set by <application>initdb</application> will
4014 have entries where <literal>privtype</literal> is
4015 <literal>'i'</literal>, while objects which have initial privileges set
4016 by <command>CREATE EXTENSION</command> will have entries where
4017 <literal>privtype</literal> is <literal>'e'</literal>.
4021 <title><structname>pg_init_privs</structname> Columns</title>
4028 <entry>References</entry>
4029 <entry>Description</entry>
4035 <entry><structfield>objoid</structfield></entry>
4036 <entry><type>oid</type></entry>
4037 <entry>any OID column</entry>
4038 <entry>The OID of the specific object</entry>
4042 <entry><structfield>classoid</structfield></entry>
4043 <entry><type>oid</type></entry>
4044 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
4045 <entry>The OID of the system catalog the object is in</entry>
4049 <entry><structfield>objsubid</structfield></entry>
4050 <entry><type>int4</type></entry>
4053 For a table column, this is the column number (the
4054 <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to the
4055 table itself). For all other object types, this column is
4061 <entry><structfield>privtype</structfield></entry>
4062 <entry><type>char</type></entry>
4065 A code defining the type of initial privilege of this object; see text
4070 <entry><structfield>initprivs</structfield></entry>
4071 <entry><type>aclitem[]</type></entry>
4074 The initial access privileges; see
4075 <xref linkend="sql-grant"/> and
4076 <xref linkend="sql-revoke"/>
4088 <sect1 id="catalog-pg-language">
4089 <title><structname>pg_language</structname></title>
4091 <indexterm zone="catalog-pg-language">
4092 <primary>pg_language</primary>
4096 The catalog <structname>pg_language</structname> registers
4097 languages in which you can write functions or stored procedures.
4098 See <xref linkend="sql-createlanguage"/>
4099 and <xref linkend="xplang"/> for more information about language handlers.
4103 <title><structname>pg_language</structname> Columns</title>
4110 <entry>References</entry>
4111 <entry>Description</entry>
4117 <entry><structfield>oid</structfield></entry>
4118 <entry><type>oid</type></entry>
4120 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4124 <entry><structfield>lanname</structfield></entry>
4125 <entry><type>name</type></entry>
4127 <entry>Name of the language</entry>
4131 <entry><structfield>lanowner</structfield></entry>
4132 <entry><type>oid</type></entry>
4133 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4134 <entry>Owner of the language</entry>
4138 <entry><structfield>lanispl</structfield></entry>
4139 <entry><type>bool</type></entry>
4142 This is false for internal languages (such as
4143 <acronym>SQL</acronym>) and true for user-defined languages.
4144 Currently, <application>pg_dump</application> still uses this
4145 to determine which languages need to be dumped, but this might be
4146 replaced by a different mechanism in the future.
4151 <entry><structfield>lanpltrusted</structfield></entry>
4152 <entry><type>bool</type></entry>
4155 True if this is a trusted language, which means that it is believed
4156 not to grant access to anything outside the normal SQL execution
4157 environment. Only superusers can create functions in untrusted
4163 <entry><structfield>lanplcallfoid</structfield></entry>
4164 <entry><type>oid</type></entry>
4165 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4167 For noninternal languages this references the language
4168 handler, which is a special function that is responsible for
4169 executing all functions that are written in the particular
4175 <entry><structfield>laninline</structfield></entry>
4176 <entry><type>oid</type></entry>
4177 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4179 This references a function that is responsible for executing
4180 <quote>inline</quote> anonymous code blocks
4181 (<xref linkend="sql-do"/> blocks).
4182 Zero if inline blocks are not supported.
4187 <entry><structfield>lanvalidator</structfield></entry>
4188 <entry><type>oid</type></entry>
4189 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4191 This references a language validator function that is responsible
4192 for checking the syntax and validity of new functions when they
4193 are created. Zero if no validator is provided.
4198 <entry><structfield>lanacl</structfield></entry>
4199 <entry><type>aclitem[]</type></entry>
4202 Access privileges; see
4203 <xref linkend="sql-grant"/> and
4204 <xref linkend="sql-revoke"/>
4215 <sect1 id="catalog-pg-largeobject">
4216 <title><structname>pg_largeobject</structname></title>
4218 <indexterm zone="catalog-pg-largeobject">
4219 <primary>pg_largeobject</primary>
4223 The catalog <structname>pg_largeobject</structname> holds the data making up
4224 <quote>large objects</quote>. A large object is identified by an OID
4225 assigned when it is created. Each large object is broken into
4226 segments or <quote>pages</quote> small enough to be conveniently stored as rows
4227 in <structname>pg_largeobject</structname>.
4228 The amount of data per page is defined to be <symbol>LOBLKSIZE</symbol> (which is currently
4229 <literal>BLCKSZ/4</literal>, or typically 2 kB).
4233 Prior to <productname>PostgreSQL</productname> 9.0, there was no permission structure
4234 associated with large objects. As a result,
4235 <structname>pg_largeobject</structname> was publicly readable and could be
4236 used to obtain the OIDs (and contents) of all large objects in the system.
4237 This is no longer the case; use
4238 <link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link>
4239 to obtain a list of large object OIDs.
4243 <title><structname>pg_largeobject</structname> Columns</title>
4250 <entry>References</entry>
4251 <entry>Description</entry>
4257 <entry><structfield>loid</structfield></entry>
4258 <entry><type>oid</type></entry>
4259 <entry><literal><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link>.oid</literal></entry>
4260 <entry>Identifier of the large object that includes this page</entry>
4264 <entry><structfield>pageno</structfield></entry>
4265 <entry><type>int4</type></entry>
4267 <entry>Page number of this page within its large object
4268 (counting from zero)</entry>
4272 <entry><structfield>data</structfield></entry>
4273 <entry><type>bytea</type></entry>
4276 Actual data stored in the large object.
4277 This will never be more than <symbol>LOBLKSIZE</symbol> bytes and might be less.
4285 Each row of <structname>pg_largeobject</structname> holds data
4286 for one page of a large object, beginning at
4287 byte offset (<literal>pageno * LOBLKSIZE</literal>) within the object. The implementation
4288 allows sparse storage: pages might be missing, and might be shorter than
4289 <literal>LOBLKSIZE</literal> bytes even if they are not the last page of the object.
4290 Missing regions within a large object read as zeroes.
4295 <sect1 id="catalog-pg-largeobject-metadata">
4296 <title><structname>pg_largeobject_metadata</structname></title>
4298 <indexterm zone="catalog-pg-largeobject-metadata">
4299 <primary>pg_largeobject_metadata</primary>
4303 The catalog <structname>pg_largeobject_metadata</structname>
4304 holds metadata associated with large objects. The actual large object
4306 <link linkend="catalog-pg-largeobject"><structname>pg_largeobject</structname></link>.
4310 <title><structname>pg_largeobject_metadata</structname> Columns</title>
4317 <entry>References</entry>
4318 <entry>Description</entry>
4324 <entry><structfield>oid</structfield></entry>
4325 <entry><type>oid</type></entry>
4327 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4331 <entry><structfield>lomowner</structfield></entry>
4332 <entry><type>oid</type></entry>
4333 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4334 <entry>Owner of the large object</entry>
4338 <entry><structfield>lomacl</structfield></entry>
4339 <entry><type>aclitem[]</type></entry>
4342 Access privileges; see
4343 <xref linkend="sql-grant"/> and
4344 <xref linkend="sql-revoke"/>
4355 <sect1 id="catalog-pg-namespace">
4356 <title><structname>pg_namespace</structname></title>
4358 <indexterm zone="catalog-pg-namespace">
4359 <primary>pg_namespace</primary>
4363 The catalog <structname>pg_namespace</structname> stores namespaces.
4364 A namespace is the structure underlying SQL schemas: each namespace
4365 can have a separate collection of relations, types, etc. without name
4370 <title><structname>pg_namespace</structname> Columns</title>
4377 <entry>References</entry>
4378 <entry>Description</entry>
4384 <entry><structfield>oid</structfield></entry>
4385 <entry><type>oid</type></entry>
4387 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4391 <entry><structfield>nspname</structfield></entry>
4392 <entry><type>name</type></entry>
4394 <entry>Name of the namespace</entry>
4398 <entry><structfield>nspowner</structfield></entry>
4399 <entry><type>oid</type></entry>
4400 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4401 <entry>Owner of the namespace</entry>
4405 <entry><structfield>nspacl</structfield></entry>
4406 <entry><type>aclitem[]</type></entry>
4409 Access privileges; see
4410 <xref linkend="sql-grant"/> and
4411 <xref linkend="sql-revoke"/>
4422 <sect1 id="catalog-pg-opclass">
4423 <title><structname>pg_opclass</structname></title>
4425 <indexterm zone="catalog-pg-opclass">
4426 <primary>pg_opclass</primary>
4430 The catalog <structname>pg_opclass</structname> defines
4431 index access method operator classes. Each operator class defines
4432 semantics for index columns of a particular data type and a particular
4433 index access method. An operator class essentially specifies that a
4434 particular operator family is applicable to a particular indexable column
4435 data type. The set of operators from the family that are actually usable
4436 with the indexed column are whichever ones accept the column's data type
4437 as their left-hand input.
4441 Operator classes are described at length in <xref linkend="xindex"/>.
4445 <title><structname>pg_opclass</structname> Columns</title>
4452 <entry>References</entry>
4453 <entry>Description</entry>
4459 <entry><structfield>oid</structfield></entry>
4460 <entry><type>oid</type></entry>
4462 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4466 <entry><structfield>opcmethod</structfield></entry>
4467 <entry><type>oid</type></entry>
4468 <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
4469 <entry>Index access method operator class is for</entry>
4473 <entry><structfield>opcname</structfield></entry>
4474 <entry><type>name</type></entry>
4476 <entry>Name of this operator class</entry>
4480 <entry><structfield>opcnamespace</structfield></entry>
4481 <entry><type>oid</type></entry>
4482 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
4483 <entry>Namespace of this operator class</entry>
4487 <entry><structfield>opcowner</structfield></entry>
4488 <entry><type>oid</type></entry>
4489 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4490 <entry>Owner of the operator class</entry>
4494 <entry><structfield>opcfamily</structfield></entry>
4495 <entry><type>oid</type></entry>
4496 <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
4497 <entry>Operator family containing the operator class</entry>
4501 <entry><structfield>opcintype</structfield></entry>
4502 <entry><type>oid</type></entry>
4503 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
4504 <entry>Data type that the operator class indexes</entry>
4508 <entry><structfield>opcdefault</structfield></entry>
4509 <entry><type>bool</type></entry>
4511 <entry>True if this operator class is the default for <structfield>opcintype</structfield></entry>
4515 <entry><structfield>opckeytype</structfield></entry>
4516 <entry><type>oid</type></entry>
4517 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
4518 <entry>Type of data stored in index, or zero if same as <structfield>opcintype</structfield></entry>
4526 An operator class's <structfield>opcmethod</structfield> must match the
4527 <structname>opfmethod</structname> of its containing operator family.
4528 Also, there must be no more than one <structname>pg_opclass</structname>
4529 row having <structname>opcdefault</structname> true for any given combination of
4530 <structname>opcmethod</structname> and <structname>opcintype</structname>.
4536 <sect1 id="catalog-pg-operator">
4537 <title><structname>pg_operator</structname></title>
4539 <indexterm zone="catalog-pg-operator">
4540 <primary>pg_operator</primary>
4544 The catalog <structname>pg_operator</structname> stores information about operators.
4545 See <xref linkend="sql-createoperator"/>
4546 and <xref linkend="xoper"/> for more information.
4550 <title><structname>pg_operator</structname> Columns</title>
4557 <entry>References</entry>
4558 <entry>Description</entry>
4564 <entry><structfield>oid</structfield></entry>
4565 <entry><type>oid</type></entry>
4567 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4571 <entry><structfield>oprname</structfield></entry>
4572 <entry><type>name</type></entry>
4574 <entry>Name of the operator</entry>
4578 <entry><structfield>oprnamespace</structfield></entry>
4579 <entry><type>oid</type></entry>
4580 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
4582 The OID of the namespace that contains this operator
4587 <entry><structfield>oprowner</structfield></entry>
4588 <entry><type>oid</type></entry>
4589 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4590 <entry>Owner of the operator</entry>
4594 <entry><structfield>oprkind</structfield></entry>
4595 <entry><type>char</type></entry>
4598 <literal>b</literal> = infix (<quote>both</quote>), <literal>l</literal> = prefix
4599 (<quote>left</quote>), <literal>r</literal> = postfix (<quote>right</quote>)
4604 <entry><structfield>oprcanmerge</structfield></entry>
4605 <entry><type>bool</type></entry>
4607 <entry>This operator supports merge joins</entry>
4611 <entry><structfield>oprcanhash</structfield></entry>
4612 <entry><type>bool</type></entry>
4614 <entry>This operator supports hash joins</entry>
4618 <entry><structfield>oprleft</structfield></entry>
4619 <entry><type>oid</type></entry>
4620 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
4621 <entry>Type of the left operand</entry>
4625 <entry><structfield>oprright</structfield></entry>
4626 <entry><type>oid</type></entry>
4627 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
4628 <entry>Type of the right operand</entry>
4632 <entry><structfield>oprresult</structfield></entry>
4633 <entry><type>oid</type></entry>
4634 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
4635 <entry>Type of the result</entry>
4639 <entry><structfield>oprcom</structfield></entry>
4640 <entry><type>oid</type></entry>
4641 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
4642 <entry>Commutator of this operator, if any</entry>
4646 <entry><structfield>oprnegate</structfield></entry>
4647 <entry><type>oid</type></entry>
4648 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
4649 <entry>Negator of this operator, if any</entry>
4653 <entry><structfield>oprcode</structfield></entry>
4654 <entry><type>regproc</type></entry>
4655 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4656 <entry>Function that implements this operator</entry>
4660 <entry><structfield>oprrest</structfield></entry>
4661 <entry><type>regproc</type></entry>
4662 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4663 <entry>Restriction selectivity estimation function for this operator</entry>
4667 <entry><structfield>oprjoin</structfield></entry>
4668 <entry><type>regproc</type></entry>
4669 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
4670 <entry>Join selectivity estimation function for this operator</entry>
4677 Unused column contain zeroes. For example, <structfield>oprleft</structfield>
4678 is zero for a prefix operator.
4684 <sect1 id="catalog-pg-opfamily">
4685 <title><structname>pg_opfamily</structname></title>
4687 <indexterm zone="catalog-pg-opfamily">
4688 <primary>pg_opfamily</primary>
4692 The catalog <structname>pg_opfamily</structname> defines operator families.
4693 Each operator family is a collection of operators and associated
4694 support routines that implement the semantics specified for a particular
4695 index access method. Furthermore, the operators in a family are all
4696 <quote>compatible</quote>, in a way that is specified by the access method.
4697 The operator family concept allows cross-data-type operators to be used
4698 with indexes and to be reasoned about using knowledge of access method
4703 Operator families are described at length in <xref linkend="xindex"/>.
4707 <title><structname>pg_opfamily</structname> Columns</title>
4714 <entry>References</entry>
4715 <entry>Description</entry>
4721 <entry><structfield>oid</structfield></entry>
4722 <entry><type>oid</type></entry>
4724 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
4728 <entry><structfield>opfmethod</structfield></entry>
4729 <entry><type>oid</type></entry>
4730 <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
4731 <entry>Index access method operator family is for</entry>
4735 <entry><structfield>opfname</structfield></entry>
4736 <entry><type>name</type></entry>
4738 <entry>Name of this operator family</entry>
4742 <entry><structfield>opfnamespace</structfield></entry>
4743 <entry><type>oid</type></entry>
4744 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
4745 <entry>Namespace of this operator family</entry>
4749 <entry><structfield>opfowner</structfield></entry>
4750 <entry><type>oid</type></entry>
4751 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
4752 <entry>Owner of the operator family</entry>
4760 The majority of the information defining an operator family is not in its
4761 <structname>pg_opfamily</structname> row, but in the associated rows in
4762 <link linkend="catalog-pg-amop"><structname>pg_amop</structname></link>,
4763 <link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link>,
4765 <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.
4771 <sect1 id="catalog-pg-partitioned-table">
4772 <title><structname>pg_partitioned_table</structname></title>
4774 <indexterm zone="catalog-pg-partitioned-table">
4775 <primary>pg_partitioned_table</primary>
4779 The catalog <structname>pg_partitioned_table</structname> stores
4780 information about how tables are partitioned.
4784 <title><structname>pg_partitioned_table</structname> Columns</title>
4791 <entry>References</entry>
4792 <entry>Description</entry>
4799 <entry><structfield>partrelid</structfield></entry>
4800 <entry><type>oid</type></entry>
4801 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
4802 <entry>The OID of the <structname>pg_class</structname> entry for this partitioned table</entry>
4806 <entry><structfield>partstrat</structfield></entry>
4807 <entry><type>char</type></entry>
4810 Partitioning strategy; <literal>l</literal> = list partitioned table,
4811 <literal>r</literal> = range partitioned table
4816 <entry><structfield>partnatts</structfield></entry>
4817 <entry><type>int2</type></entry>
4819 <entry>The number of columns in partition key</entry>
4823 <entry><structfield>partdefid</structfield></entry>
4824 <entry><type>oid</type></entry>
4825 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
4827 The OID of the <structname>pg_class</structname> entry for the default partition
4828 of this partitioned table, or zero if this partitioned table does not
4829 have a default partition.
4834 <entry><structfield>partattrs</structfield></entry>
4835 <entry><type>int2vector</type></entry>
4836 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
4838 This is an array of <structfield>partnatts</structfield> values that
4839 indicate which table columns are part of the partition key. For
4840 example, a value of <literal>1 3</literal> would mean that the first
4841 and the third table columns make up the partition key. A zero in this
4842 array indicates that the corresponding partition key column is an
4843 expression, rather than a simple column reference.
4848 <entry><structfield>partclass</structfield></entry>
4849 <entry><type>oidvector</type></entry>
4850 <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
4852 For each column in the partition key, this contains the OID of the
4853 operator class to use. See
4854 <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
4859 <entry><structfield>partcollation</structfield></entry>
4860 <entry><type>oidvector</type></entry>
4861 <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
4863 For each column in the partition key, this contains the OID of the
4864 collation to use for partitioning, or zero if the column is not
4865 of a collatable data type.
4870 <entry><structfield>partexprs</structfield></entry>
4871 <entry><type>pg_node_tree</type></entry>
4874 Expression trees (in <function>nodeToString()</function>
4875 representation) for partition key columns that are not simple column
4876 references. This is a list with one element for each zero
4877 entry in <structfield>partattrs</structfield>. Null if all partition key columns
4878 are simple references.
4888 <sect1 id="catalog-pg-pltemplate">
4889 <title><structname>pg_pltemplate</structname></title>
4891 <indexterm zone="catalog-pg-pltemplate">
4892 <primary>pg_pltemplate</primary>
4896 The catalog <structname>pg_pltemplate</structname> stores
4897 <quote>template</quote> information for procedural languages.
4898 A template for a language allows the language to be created in a
4899 particular database by a simple <command>CREATE LANGUAGE</command> command,
4900 with no need to specify implementation details.
4904 Unlike most system catalogs, <structname>pg_pltemplate</structname>
4905 is shared across all databases of a cluster: there is only one
4906 copy of <structname>pg_pltemplate</structname> per cluster, not
4907 one per database. This allows the information to be accessible in
4908 each database as it is needed.
4912 <title><structname>pg_pltemplate</structname> Columns</title>
4919 <entry>Description</entry>
4925 <entry><structfield>tmplname</structfield></entry>
4926 <entry><type>name</type></entry>
4927 <entry>Name of the language this template is for</entry>
4931 <entry><structfield>tmpltrusted</structfield></entry>
4932 <entry><type>boolean</type></entry>
4933 <entry>True if language is considered trusted</entry>
4937 <entry><structfield>tmpldbacreate</structfield></entry>
4938 <entry><type>boolean</type></entry>
4939 <entry>True if language may be created by a database owner</entry>
4943 <entry><structfield>tmplhandler</structfield></entry>
4944 <entry><type>text</type></entry>
4945 <entry>Name of call handler function</entry>
4949 <entry><structfield>tmplinline</structfield></entry>
4950 <entry><type>text</type></entry>
4951 <entry>Name of anonymous-block handler function, or null if none</entry>
4955 <entry><structfield>tmplvalidator</structfield></entry>
4956 <entry><type>text</type></entry>
4957 <entry>Name of validator function, or null if none</entry>
4961 <entry><structfield>tmpllibrary</structfield></entry>
4962 <entry><type>text</type></entry>
4963 <entry>Path of shared library that implements language</entry>
4967 <entry><structfield>tmplacl</structfield></entry>
4968 <entry><type>aclitem[]</type></entry>
4969 <entry>Access privileges for template (not actually used)</entry>
4977 There are not currently any commands that manipulate procedural language
4978 templates; to change the built-in information, a superuser must modify
4979 the table using ordinary <command>INSERT</command>, <command>DELETE</command>,
4980 or <command>UPDATE</command> commands.
4985 It is likely that <structname>pg_pltemplate</structname> will be removed in some
4986 future release of <productname>PostgreSQL</productname>, in favor of
4987 keeping this knowledge about procedural languages in their respective
4988 extension installation scripts.
4995 <sect1 id="catalog-pg-policy">
4996 <title><structname>pg_policy</structname></title>
4998 <indexterm zone="catalog-pg-policy">
4999 <primary>pg_policy</primary>
5003 The catalog <structname>pg_policy</structname> stores row level
5004 security policies for tables. A policy includes the kind of
5005 command that it applies to (possibly all commands), the roles that it
5006 applies to, the expression to be added as a security-barrier
5007 qualification to queries that include the table, and the expression
5008 to be added as a <literal>WITH CHECK</literal> option for queries that attempt to
5009 add new records to the table.
5014 <title><structname>pg_policy</structname> Columns</title>
5021 <entry>References</entry>
5022 <entry>Description</entry>
5028 <entry><structfield>polname</structfield></entry>
5029 <entry><type>name</type></entry>
5031 <entry>The name of the policy</entry>
5035 <entry><structfield>polrelid</structfield></entry>
5036 <entry><type>oid</type></entry>
5037 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
5038 <entry>The table to which the policy applies</entry>
5042 <entry><structfield>polcmd</structfield></entry>
5043 <entry><type>char</type></entry>
5045 <entry>The command type to which the policy is applied:
5046 <literal>r</literal> for <command>SELECT</command>,
5047 <literal>a</literal> for <command>INSERT</command>,
5048 <literal>w</literal> for <command>UPDATE</command>,
5049 <literal>d</literal> for <command>DELETE</command>,
5050 or <literal>*</literal> for all</entry>
5054 <entry><structfield>polpermissive</structfield></entry>
5055 <entry><type>boolean</type></entry>
5057 <entry>Is the policy permissive or restrictive?</entry>
5061 <entry><structfield>polroles</structfield></entry>
5062 <entry><type>oid[]</type></entry>
5063 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
5064 <entry>The roles to which the policy is applied</entry>
5068 <entry><structfield>polqual</structfield></entry>
5069 <entry><type>pg_node_tree</type></entry>
5071 <entry>The expression tree to be added to the security barrier qualifications for queries that use the table</entry>
5075 <entry><structfield>polwithcheck</structfield></entry>
5076 <entry><type>pg_node_tree</type></entry>
5078 <entry>The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table</entry>
5087 Policies stored in <structname>pg_policy</structname> are applied only when
5088 <structname>pg_class</structname>.<structfield>relrowsecurity</structfield> is set for
5095 <sect1 id="catalog-pg-proc">
5096 <title><structname>pg_proc</structname></title>
5098 <indexterm zone="catalog-pg-proc">
5099 <primary>pg_proc</primary>
5103 The catalog <structname>pg_proc</structname> stores information about
5104 functions, procedures, aggregate functions, and window functions
5105 (collectively also known as routines). See <xref
5106 linkend="sql-createfunction"/>, <xref linkend="sql-createprocedure"/>, and
5107 <xref linkend="xfunc"/> for more information.
5111 If <structfield>prokind</structfield> indicates that the entry is for an
5112 aggregate function, there should be a matching row in
5113 <structfield>pg_aggregate</structfield>.
5117 <title><structname>pg_proc</structname> Columns</title>
5124 <entry>References</entry>
5125 <entry>Description</entry>
5131 <entry><structfield>oid</structfield></entry>
5132 <entry><type>oid</type></entry>
5134 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
5138 <entry><structfield>proname</structfield></entry>
5139 <entry><type>name</type></entry>
5141 <entry>Name of the function</entry>
5145 <entry><structfield>pronamespace</structfield></entry>
5146 <entry><type>oid</type></entry>
5147 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
5149 The OID of the namespace that contains this function
5154 <entry><structfield>proowner</structfield></entry>
5155 <entry><type>oid</type></entry>
5156 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
5157 <entry>Owner of the function</entry>
5161 <entry><structfield>prolang</structfield></entry>
5162 <entry><type>oid</type></entry>
5163 <entry><literal><link linkend="catalog-pg-language"><structname>pg_language</structname></link>.oid</literal></entry>
5164 <entry>Implementation language or call interface of this function</entry>
5168 <entry><structfield>procost</structfield></entry>
5169 <entry><type>float4</type></entry>
5171 <entry>Estimated execution cost (in units of
5172 <xref linkend="guc-cpu-operator-cost"/>); if <structfield>proretset</structfield>,
5173 this is cost per row returned</entry>
5177 <entry><structfield>prorows</structfield></entry>
5178 <entry><type>float4</type></entry>
5180 <entry>Estimated number of result rows (zero if not <structfield>proretset</structfield>)</entry>
5184 <entry><structfield>provariadic</structfield></entry>
5185 <entry><type>oid</type></entry>
5186 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5187 <entry>Data type of the variadic array parameter's elements,
5188 or zero if the function does not have a variadic parameter</entry>
5192 <entry><structfield>protransform</structfield></entry>
5193 <entry><type>regproc</type></entry>
5194 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
5195 <entry>Calls to this function can be simplified by this other function
5196 (see <xref linkend="xfunc-transform-functions"/>)</entry>
5200 <entry><structfield>prokind</structfield></entry>
5201 <entry><type>char</type></entry>
5203 <entry><literal>f</literal> for a normal function, <literal>p</literal>
5204 for a procedure, <literal>a</literal> for an aggregate function, or
5205 <literal>w</literal> for a window function</entry>
5209 <entry><structfield>prosecdef</structfield></entry>
5210 <entry><type>bool</type></entry>
5212 <entry>Function is a security definer (i.e., a <quote>setuid</quote>
5217 <entry><structfield>proleakproof</structfield></entry>
5218 <entry><type>bool</type></entry>
5221 The function has no side effects. No information about the
5222 arguments is conveyed except via the return value. Any function
5223 that might throw an error depending on the values of its arguments
5229 <entry><structfield>proisstrict</structfield></entry>
5230 <entry><type>bool</type></entry>
5233 Function returns null if any call argument is null. In that
5234 case the function won't actually be called at all. Functions
5235 that are not <quote>strict</quote> must be prepared to handle
5241 <entry><structfield>proretset</structfield></entry>
5242 <entry><type>bool</type></entry>
5244 <entry>Function returns a set (i.e., multiple values of the specified
5249 <entry><structfield>provolatile</structfield></entry>
5250 <entry><type>char</type></entry>
5253 <structfield>provolatile</structfield> tells whether the function's
5254 result depends only on its input arguments, or is affected by outside
5256 It is <literal>i</literal> for <quote>immutable</quote> functions,
5257 which always deliver the same result for the same inputs.
5258 It is <literal>s</literal> for <quote>stable</quote> functions,
5259 whose results (for fixed inputs) do not change within a scan.
5260 It is <literal>v</literal> for <quote>volatile</quote> functions,
5261 whose results might change at any time. (Use <literal>v</literal> also
5262 for functions with side-effects, so that calls to them cannot get
5268 <entry><structfield>proparallel</structfield></entry>
5269 <entry><type>char</type></entry>
5272 <structfield>proparallel</structfield> tells whether the function
5273 can be safely run in parallel mode.
5274 It is <literal>s</literal> for functions which are safe to run in
5275 parallel mode without restriction.
5276 It is <literal>r</literal> for functions which can be run in parallel
5277 mode, but their execution is restricted to the parallel group leader;
5278 parallel worker processes cannot invoke these functions.
5279 It is <literal>u</literal> for functions which are unsafe in parallel
5280 mode; the presence of such a function forces a serial execution plan.
5285 <entry><structfield>pronargs</structfield></entry>
5286 <entry><type>int2</type></entry>
5288 <entry>Number of input arguments</entry>
5292 <entry><structfield>pronargdefaults</structfield></entry>
5293 <entry><type>int2</type></entry>
5295 <entry>Number of arguments that have defaults</entry>
5299 <entry><structfield>prorettype</structfield></entry>
5300 <entry><type>oid</type></entry>
5301 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5302 <entry>Data type of the return value</entry>
5306 <entry><structfield>proargtypes</structfield></entry>
5307 <entry><type>oidvector</type></entry>
5308 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5310 An array with the data types of the function arguments. This includes
5311 only input arguments (including <literal>INOUT</literal> and
5312 <literal>VARIADIC</literal> arguments), and thus represents
5313 the call signature of the function.
5318 <entry><structfield>proallargtypes</structfield></entry>
5319 <entry><type>oid[]</type></entry>
5320 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5322 An array with the data types of the function arguments. This includes
5323 all arguments (including <literal>OUT</literal> and
5324 <literal>INOUT</literal> arguments); however, if all the
5325 arguments are <literal>IN</literal> arguments, this field will be null.
5326 Note that subscripting is 1-based, whereas for historical reasons
5327 <structfield>proargtypes</structfield> is subscripted from 0.
5332 <entry><structfield>proargmodes</structfield></entry>
5333 <entry><type>char[]</type></entry>
5336 An array with the modes of the function arguments, encoded as
5337 <literal>i</literal> for <literal>IN</literal> arguments,
5338 <literal>o</literal> for <literal>OUT</literal> arguments,
5339 <literal>b</literal> for <literal>INOUT</literal> arguments,
5340 <literal>v</literal> for <literal>VARIADIC</literal> arguments,
5341 <literal>t</literal> for <literal>TABLE</literal> arguments.
5342 If all the arguments are <literal>IN</literal> arguments,
5343 this field will be null.
5344 Note that subscripts correspond to positions of
5345 <structfield>proallargtypes</structfield> not <structfield>proargtypes</structfield>.
5350 <entry><structfield>proargnames</structfield></entry>
5351 <entry><type>text[]</type></entry>
5354 An array with the names of the function arguments.
5355 Arguments without a name are set to empty strings in the array.
5356 If none of the arguments have a name, this field will be null.
5357 Note that subscripts correspond to positions of
5358 <structfield>proallargtypes</structfield> not <structfield>proargtypes</structfield>.
5363 <entry><structfield>proargdefaults</structfield></entry>
5364 <entry><type>pg_node_tree</type></entry>
5367 Expression trees (in <function>nodeToString()</function> representation)
5368 for default values. This is a list with
5369 <structfield>pronargdefaults</structfield> elements, corresponding to the last
5370 <replaceable>N</replaceable> <emphasis>input</emphasis> arguments (i.e., the last
5371 <replaceable>N</replaceable> <structfield>proargtypes</structfield> positions).
5372 If none of the arguments have defaults, this field will be null.
5377 <entry><structfield>protrftypes</structfield></entry>
5378 <entry><type>oid[]</type></entry>
5381 Data type OIDs for which to apply transforms.
5386 <entry><structfield>prosrc</structfield></entry>
5387 <entry><type>text</type></entry>
5390 This tells the function handler how to invoke the function. It
5391 might be the actual source code of the function for interpreted
5392 languages, a link symbol, a file name, or just about anything
5393 else, depending on the implementation language/call convention.
5398 <entry><structfield>probin</structfield></entry>
5399 <entry><type>text</type></entry>
5402 Additional information about how to invoke the function.
5403 Again, the interpretation is language-specific.
5408 <entry><structfield>proconfig</structfield></entry>
5409 <entry><type>text[]</type></entry>
5411 <entry>Function's local settings for run-time configuration variables</entry>
5415 <entry><structfield>proacl</structfield></entry>
5416 <entry><type>aclitem[]</type></entry>
5419 Access privileges; see
5420 <xref linkend="sql-grant"/> and
5421 <xref linkend="sql-revoke"/>
5430 For compiled functions, both built-in and dynamically loaded,
5431 <structfield>prosrc</structfield> contains the function's C-language
5432 name (link symbol). For all other currently-known language types,
5433 <structfield>prosrc</structfield> contains the function's source
5434 text. <structfield>probin</structfield> is unused except for
5435 dynamically-loaded C functions, for which it gives the name of the
5436 shared library file containing the function.
5441 <sect1 id="catalog-pg-publication">
5442 <title><structname>pg_publication</structname></title>
5444 <indexterm zone="catalog-pg-publication">
5445 <primary>pg_publication</primary>
5449 The catalog <structname>pg_publication</structname> contains all
5450 publications created in the database. For more on publications see
5451 <xref linkend="logical-replication-publication"/>.
5455 <title><structname>pg_publication</structname> Columns</title>
5462 <entry>References</entry>
5463 <entry>Description</entry>
5469 <entry><structfield>oid</structfield></entry>
5470 <entry><type>oid</type></entry>
5472 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
5476 <entry><structfield>pubname</structfield></entry>
5477 <entry><type>name</type></entry>
5479 <entry>Name of the publication</entry>
5483 <entry><structfield>pubowner</structfield></entry>
5484 <entry><type>oid</type></entry>
5485 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
5486 <entry>Owner of the publication</entry>
5490 <entry><structfield>puballtables</structfield></entry>
5491 <entry><type>bool</type></entry>
5493 <entry>If true, this publication automatically includes all tables
5494 in the database, including any that will be created in the future.
5499 <entry><structfield>pubinsert</structfield></entry>
5500 <entry><type>bool</type></entry>
5502 <entry>If true, <command>INSERT</command> operations are replicated for
5503 tables in the publication.</entry>
5507 <entry><structfield>pubupdate</structfield></entry>
5508 <entry><type>bool</type></entry>
5510 <entry>If true, <command>UPDATE</command> operations are replicated for
5511 tables in the publication.</entry>
5515 <entry><structfield>pubdelete</structfield></entry>
5516 <entry><type>bool</type></entry>
5518 <entry>If true, <command>DELETE</command> operations are replicated for
5519 tables in the publication.</entry>
5526 <sect1 id="catalog-pg-publication-rel">
5527 <title><structname>pg_publication_rel</structname></title>
5529 <indexterm zone="catalog-pg-publication-rel">
5530 <primary>pg_publication_rel</primary>
5534 The catalog <structname>pg_publication_rel</structname> contains the
5535 mapping between relations and publications in the database. This is a
5536 many-to-many mapping. See also <xref linkend="view-pg-publication-tables"/>
5537 for a more user-friendly view of this information.
5541 <title><structname>pg_publication_rel</structname> Columns</title>
5548 <entry>References</entry>
5549 <entry>Description</entry>
5555 <entry><structfield>prpubid</structfield></entry>
5556 <entry><type>oid</type></entry>
5557 <entry><literal><link linkend="catalog-pg-publication"><structname>pg_publication</structname></link>.oid</literal></entry>
5558 <entry>Reference to publication</entry>
5562 <entry><structfield>prrelid</structfield></entry>
5563 <entry><type>oid</type></entry>
5564 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
5565 <entry>Reference to relation</entry>
5572 <sect1 id="catalog-pg-range">
5573 <title><structname>pg_range</structname></title>
5575 <indexterm zone="catalog-pg-range">
5576 <primary>pg_range</primary>
5580 The catalog <structname>pg_range</structname> stores information about
5581 range types. This is in addition to the types' entries in
5582 <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.
5586 <title><structname>pg_range</structname> Columns</title>
5593 <entry>References</entry>
5594 <entry>Description</entry>
5600 <entry><structfield>rngtypid</structfield></entry>
5601 <entry><type>oid</type></entry>
5602 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5603 <entry>OID of the range type</entry>
5607 <entry><structfield>rngsubtype</structfield></entry>
5608 <entry><type>oid</type></entry>
5609 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5610 <entry>OID of the element type (subtype) of this range type</entry>
5614 <entry><structfield>rngcollation</structfield></entry>
5615 <entry><type>oid</type></entry>
5616 <entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
5617 <entry>OID of the collation used for range comparisons, or 0 if none</entry>
5621 <entry><structfield>rngsubopc</structfield></entry>
5622 <entry><type>oid</type></entry>
5623 <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
5624 <entry>OID of the subtype's operator class used for range comparisons</entry>
5628 <entry><structfield>rngcanonical</structfield></entry>
5629 <entry><type>regproc</type></entry>
5630 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
5631 <entry>OID of the function to convert a range value into canonical form,
5632 or 0 if none</entry>
5636 <entry><structfield>rngsubdiff</structfield></entry>
5637 <entry><type>regproc</type></entry>
5638 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
5639 <entry>OID of the function to return the difference between two element
5640 values as <type>double precision</type>, or 0 if none</entry>
5647 <structfield>rngsubopc</structfield> (plus <structfield>rngcollation</structfield>, if the
5648 element type is collatable) determines the sort ordering used by the range
5649 type. <structfield>rngcanonical</structfield> is used when the element type is
5650 discrete. <structfield>rngsubdiff</structfield> is optional but should be supplied to
5651 improve performance of GiST indexes on the range type.
5656 <sect1 id="catalog-pg-replication-origin">
5657 <title><structname>pg_replication_origin</structname></title>
5659 <indexterm zone="catalog-pg-replication-origin">
5660 <primary>pg_replication_origin</primary>
5664 The <structname>pg_replication_origin</structname> catalog contains
5665 all replication origins created. For more on replication origins
5666 see <xref linkend="replication-origins"/>.
5671 <title><structname>pg_replication_origin</structname> Columns</title>
5678 <entry>References</entry>
5679 <entry>Description</entry>
5685 <entry><structfield>roident</structfield></entry>
5686 <entry><type>Oid</type></entry>
5688 <entry>A unique, cluster-wide identifier for the replication
5689 origin. Should never leave the system.</entry>
5693 <entry><structfield>roname</structfield></entry>
5694 <entry><type>text</type></entry>
5696 <entry>The external, user defined, name of a replication
5704 <sect1 id="catalog-pg-rewrite">
5705 <title><structname>pg_rewrite</structname></title>
5707 <indexterm zone="catalog-pg-rewrite">
5708 <primary>pg_rewrite</primary>
5712 The catalog <structname>pg_rewrite</structname> stores rewrite rules for tables and views.
5716 <title><structname>pg_rewrite</structname> Columns</title>
5723 <entry>References</entry>
5724 <entry>Description</entry>
5730 <entry><structfield>oid</structfield></entry>
5731 <entry><type>oid</type></entry>
5733 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
5737 <entry><structfield>rulename</structfield></entry>
5738 <entry><type>name</type></entry>
5740 <entry>Rule name</entry>
5744 <entry><structfield>ev_class</structfield></entry>
5745 <entry><type>oid</type></entry>
5746 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
5747 <entry>The table this rule is for</entry>
5751 <entry><structfield>ev_type</structfield></entry>
5752 <entry><type>char</type></entry>
5755 Event type that the rule is for: 1 = <command>SELECT</command>, 2 =
5756 <command>UPDATE</command>, 3 = <command>INSERT</command>, 4 =
5757 <command>DELETE</command>
5762 <entry><structfield>ev_enabled</structfield></entry>
5763 <entry><type>char</type></entry>
5766 Controls in which <xref linkend="guc-session-replication-role"/> modes
5768 <literal>O</literal> = rule fires in <quote>origin</quote> and <quote>local</quote> modes,
5769 <literal>D</literal> = rule is disabled,
5770 <literal>R</literal> = rule fires in <quote>replica</quote> mode,
5771 <literal>A</literal> = rule fires always.
5776 <entry><structfield>is_instead</structfield></entry>
5777 <entry><type>bool</type></entry>
5779 <entry>True if the rule is an <literal>INSTEAD</literal> rule</entry>
5783 <entry><structfield>ev_qual</structfield></entry>
5784 <entry><type>pg_node_tree</type></entry>
5787 Expression tree (in the form of a
5788 <function>nodeToString()</function> representation) for the
5789 rule's qualifying condition
5794 <entry><structfield>ev_action</structfield></entry>
5795 <entry><type>pg_node_tree</type></entry>
5798 Query tree (in the form of a
5799 <function>nodeToString()</function> representation) for the
5809 <literal>pg_class.relhasrules</literal>
5810 must be true if a table has any rules in this catalog.
5816 <sect1 id="catalog-pg-seclabel">
5817 <title><structname>pg_seclabel</structname></title>
5819 <indexterm zone="catalog-pg-seclabel">
5820 <primary>pg_seclabel</primary>
5824 The catalog <structname>pg_seclabel</structname> stores security
5825 labels on database objects. Security labels can be manipulated
5826 with the <xref linkend="sql-security-label"/> command. For an easier
5827 way to view security labels, see <xref linkend="view-pg-seclabels"/>.
5831 See also <link linkend="catalog-pg-shseclabel"><structname>pg_shseclabel</structname></link>,
5832 which performs a similar function for security labels of database objects
5833 that are shared across a database cluster.
5837 <title><structname>pg_seclabel</structname> Columns</title>
5844 <entry>References</entry>
5845 <entry>Description</entry>
5851 <entry><structfield>objoid</structfield></entry>
5852 <entry><type>oid</type></entry>
5853 <entry>any OID column</entry>
5854 <entry>The OID of the object this security label pertains to</entry>
5858 <entry><structfield>classoid</structfield></entry>
5859 <entry><type>oid</type></entry>
5860 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
5861 <entry>The OID of the system catalog this object appears in</entry>
5865 <entry><structfield>objsubid</structfield></entry>
5866 <entry><type>int4</type></entry>
5869 For a security label on a table column, this is the column number (the
5870 <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to
5871 the table itself). For all other object types, this column is
5877 <entry><structfield>provider</structfield></entry>
5878 <entry><type>text</type></entry>
5880 <entry>The label provider associated with this label.</entry>
5884 <entry><structfield>label</structfield></entry>
5885 <entry><type>text</type></entry>
5887 <entry>The security label applied to this object.</entry>
5894 <sect1 id="catalog-pg-sequence">
5895 <title><structname>pg_sequence</structname></title>
5897 <indexterm zone="catalog-pg-sequence">
5898 <primary>pg_sequence</primary>
5902 The catalog <structname>pg_sequence</structname> contains information about
5903 sequences. Some of the information about sequences, such as the name and
5904 the schema, is in <structname>pg_class</structname>.
5908 <title><structname>pg_sequence</structname> Columns</title>
5915 <entry>References</entry>
5916 <entry>Description</entry>
5922 <entry><structfield>seqrelid</structfield></entry>
5923 <entry><type>oid</type></entry>
5924 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
5925 <entry>The OID of the <structname>pg_class</structname> entry for this sequence</entry>
5929 <entry><structfield>seqtypid</structfield></entry>
5930 <entry><type>oid</type></entry>
5931 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
5932 <entry>Data type of the sequence</entry>
5936 <entry><structfield>seqstart</structfield></entry>
5937 <entry><type>int8</type></entry>
5939 <entry>Start value of the sequence</entry>
5943 <entry><structfield>seqincrement</structfield></entry>
5944 <entry><type>int8</type></entry>
5946 <entry>Increment value of the sequence</entry>
5950 <entry><structfield>seqmax</structfield></entry>
5951 <entry><type>int8</type></entry>
5953 <entry>Maximum value of the sequence</entry>
5957 <entry><structfield>seqmin</structfield></entry>
5958 <entry><type>int8</type></entry>
5960 <entry>Minimum value of the sequence</entry>
5964 <entry><structfield>seqcache</structfield></entry>
5965 <entry><type>int8</type></entry>
5967 <entry>Cache size of the sequence</entry>
5971 <entry><structfield>seqcycle</structfield></entry>
5972 <entry><type>bool</type></entry>
5974 <entry>Whether the sequence cycles</entry>
5981 <sect1 id="catalog-pg-shdepend">
5982 <title><structname>pg_shdepend</structname></title>
5984 <indexterm zone="catalog-pg-shdepend">
5985 <primary>pg_shdepend</primary>
5989 The catalog <structname>pg_shdepend</structname> records the
5990 dependency relationships between database objects and shared objects,
5991 such as roles. This information allows
5992 <productname>PostgreSQL</productname> to ensure that those objects are
5993 unreferenced before attempting to delete them.
5997 See also <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>,
5998 which performs a similar function for dependencies involving objects
5999 within a single database.
6003 Unlike most system catalogs, <structname>pg_shdepend</structname>
6004 is shared across all databases of a cluster: there is only one
6005 copy of <structname>pg_shdepend</structname> per cluster, not
6010 <title><structname>pg_shdepend</structname> Columns</title>
6017 <entry>References</entry>
6018 <entry>Description</entry>
6024 <entry><structfield>dbid</structfield></entry>
6025 <entry><type>oid</type></entry>
6026 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
6027 <entry>The OID of the database the dependent object is in,
6028 or zero for a shared object</entry>
6032 <entry><structfield>classid</structfield></entry>
6033 <entry><type>oid</type></entry>
6034 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6035 <entry>The OID of the system catalog the dependent object is in</entry>
6039 <entry><structfield>objid</structfield></entry>
6040 <entry><type>oid</type></entry>
6041 <entry>any OID column</entry>
6042 <entry>The OID of the specific dependent object</entry>
6046 <entry><structfield>objsubid</structfield></entry>
6047 <entry><type>int4</type></entry>
6050 For a table column, this is the column number (the
6051 <structfield>objid</structfield> and <structfield>classid</structfield> refer to the
6052 table itself). For all other object types, this column is zero.
6057 <entry><structfield>refclassid</structfield></entry>
6058 <entry><type>oid</type></entry>
6059 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6060 <entry>The OID of the system catalog the referenced object is in
6061 (must be a shared catalog)</entry>
6065 <entry><structfield>refobjid</structfield></entry>
6066 <entry><type>oid</type></entry>
6067 <entry>any OID column</entry>
6068 <entry>The OID of the specific referenced object</entry>
6072 <entry><structfield>deptype</structfield></entry>
6073 <entry><type>char</type></entry>
6076 A code defining the specific semantics of this dependency relationship; see text
6085 In all cases, a <structname>pg_shdepend</structname> entry indicates that
6086 the referenced object cannot be dropped without also dropping the dependent
6087 object. However, there are several subflavors identified by
6088 <structfield>deptype</structfield>:
6092 <term><symbol>SHARED_DEPENDENCY_OWNER</symbol> (<literal>o</literal>)</term>
6095 The referenced object (which must be a role) is the owner of the
6102 <term><symbol>SHARED_DEPENDENCY_ACL</symbol> (<literal>a</literal>)</term>
6105 The referenced object (which must be a role) is mentioned in the
6106 ACL (access control list, i.e., privileges list) of the
6107 dependent object. (A <symbol>SHARED_DEPENDENCY_ACL</symbol> entry is
6108 not made for the owner of the object, since the owner will have
6109 a <symbol>SHARED_DEPENDENCY_OWNER</symbol> entry anyway.)
6115 <term><symbol>SHARED_DEPENDENCY_POLICY</symbol> (<literal>r</literal>)</term>
6118 The referenced object (which must be a role) is mentioned as the
6119 target of a dependent policy object.
6125 <term><symbol>SHARED_DEPENDENCY_PIN</symbol> (<literal>p</literal>)</term>
6128 There is no dependent object; this type of entry is a signal
6129 that the system itself depends on the referenced object, and so
6130 that object must never be deleted. Entries of this type are
6131 created only by <command>initdb</command>. The columns for the
6132 dependent object contain zeroes.
6138 Other dependency flavors might be needed in future. Note in particular
6139 that the current definition only supports roles as referenced objects.
6144 <sect1 id="catalog-pg-shdescription">
6145 <title><structname>pg_shdescription</structname></title>
6147 <indexterm zone="catalog-pg-shdescription">
6148 <primary>pg_shdescription</primary>
6152 The catalog <structname>pg_shdescription</structname> stores optional
6153 descriptions (comments) for shared database objects. Descriptions can be
6154 manipulated with the <xref linkend="sql-comment"/> command and viewed with
6155 <application>psql</application>'s <literal>\d</literal> commands.
6159 See also <link linkend="catalog-pg-description"><structname>pg_description</structname></link>,
6160 which performs a similar function for descriptions involving objects
6161 within a single database.
6165 Unlike most system catalogs, <structname>pg_shdescription</structname>
6166 is shared across all databases of a cluster: there is only one
6167 copy of <structname>pg_shdescription</structname> per cluster, not
6172 <title><structname>pg_shdescription</structname> Columns</title>
6179 <entry>References</entry>
6180 <entry>Description</entry>
6186 <entry><structfield>objoid</structfield></entry>
6187 <entry><type>oid</type></entry>
6188 <entry>any OID column</entry>
6189 <entry>The OID of the object this description pertains to</entry>
6193 <entry><structfield>classoid</structfield></entry>
6194 <entry><type>oid</type></entry>
6195 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6196 <entry>The OID of the system catalog this object appears in</entry>
6200 <entry><structfield>description</structfield></entry>
6201 <entry><type>text</type></entry>
6203 <entry>Arbitrary text that serves as the description of this object</entry>
6211 <sect1 id="catalog-pg-shseclabel">
6212 <title><structname>pg_shseclabel</structname></title>
6214 <indexterm zone="catalog-pg-shseclabel">
6215 <primary>pg_shseclabel</primary>
6219 The catalog <structname>pg_shseclabel</structname> stores security
6220 labels on shared database objects. Security labels can be manipulated
6221 with the <xref linkend="sql-security-label"/> command. For an easier
6222 way to view security labels, see <xref linkend="view-pg-seclabels"/>.
6226 See also <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>,
6227 which performs a similar function for security labels involving objects
6228 within a single database.
6232 Unlike most system catalogs, <structname>pg_shseclabel</structname>
6233 is shared across all databases of a cluster: there is only one
6234 copy of <structname>pg_shseclabel</structname> per cluster, not
6239 <title><structname>pg_shseclabel</structname> Columns</title>
6245 <entry>References</entry>
6246 <entry>Description</entry>
6251 <entry><structfield>objoid</structfield></entry>
6252 <entry><type>oid</type></entry>
6253 <entry>any OID column</entry>
6254 <entry>The OID of the object this security label pertains to</entry>
6257 <entry><structfield>classoid</structfield></entry>
6258 <entry><type>oid</type></entry>
6259 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6260 <entry>The OID of the system catalog this object appears in</entry>
6263 <entry><structfield>provider</structfield></entry>
6264 <entry><type>text</type></entry>
6266 <entry>The label provider associated with this label.</entry>
6269 <entry><structfield>label</structfield></entry>
6270 <entry><type>text</type></entry>
6272 <entry>The security label applied to this object.</entry>
6279 <sect1 id="catalog-pg-statistic">
6280 <title><structname>pg_statistic</structname></title>
6282 <indexterm zone="catalog-pg-statistic">
6283 <primary>pg_statistic</primary>
6287 The catalog <structname>pg_statistic</structname> stores
6288 statistical data about the contents of the database. Entries are
6289 created by <xref linkend="sql-analyze"/>
6290 and subsequently used by the query planner. Note that all the
6291 statistical data is inherently approximate, even assuming that it
6296 Normally there is one entry, with <structfield>stainherit</structfield> =
6297 <literal>false</literal>, for each table column that has been analyzed.
6298 If the table has inheritance children, a second entry with
6299 <structfield>stainherit</structfield> = <literal>true</literal> is also created. This row
6300 represents the column's statistics over the inheritance tree, i.e.,
6301 statistics for the data you'd see with
6302 <literal>SELECT <replaceable>column</replaceable> FROM <replaceable>table</replaceable>*</literal>,
6303 whereas the <structfield>stainherit</structfield> = <literal>false</literal> row represents
6305 <literal>SELECT <replaceable>column</replaceable> FROM ONLY <replaceable>table</replaceable></literal>.
6309 <structname>pg_statistic</structname> also stores statistical data about
6310 the values of index expressions. These are described as if they were
6311 actual data columns; in particular, <structfield>starelid</structfield>
6312 references the index. No entry is made for an ordinary non-expression
6313 index column, however, since it would be redundant with the entry
6314 for the underlying table column. Currently, entries for index expressions
6315 always have <structfield>stainherit</structfield> = <literal>false</literal>.
6319 Since different kinds of statistics might be appropriate for different
6320 kinds of data, <structname>pg_statistic</structname> is designed not
6321 to assume very much about what sort of statistics it stores. Only
6322 extremely general statistics (such as nullness) are given dedicated
6323 columns in <structname>pg_statistic</structname>. Everything else
6324 is stored in <quote>slots</quote>, which are groups of associated columns
6325 whose content is identified by a code number in one of the slot's columns.
6326 For more information see
6327 <filename>src/include/catalog/pg_statistic.h</filename>.
6331 <structname>pg_statistic</structname> should not be readable by the
6332 public, since even statistical information about a table's contents
6333 might be considered sensitive. (Example: minimum and maximum values
6334 of a salary column might be quite interesting.)
6335 <link linkend="view-pg-stats"><structname>pg_stats</structname></link>
6336 is a publicly readable view on
6337 <structname>pg_statistic</structname> that only exposes information
6338 about those tables that are readable by the current user.
6342 <title><structname>pg_statistic</structname> Columns</title>
6349 <entry>References</entry>
6350 <entry>Description</entry>
6356 <entry><structfield>starelid</structfield></entry>
6357 <entry><type>oid</type></entry>
6358 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6359 <entry>The table or index that the described column belongs to</entry>
6363 <entry><structfield>staattnum</structfield></entry>
6364 <entry><type>int2</type></entry>
6365 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
6366 <entry>The number of the described column</entry>
6370 <entry><structfield>stainherit</structfield></entry>
6371 <entry><type>bool</type></entry>
6373 <entry>If true, the stats include inheritance child columns, not just the
6374 values in the specified relation</entry>
6378 <entry><structfield>stanullfrac</structfield></entry>
6379 <entry><type>float4</type></entry>
6381 <entry>The fraction of the column's entries that are null</entry>
6385 <entry><structfield>stawidth</structfield></entry>
6386 <entry><type>int4</type></entry>
6388 <entry>The average stored width, in bytes, of nonnull entries</entry>
6392 <entry><structfield>stadistinct</structfield></entry>
6393 <entry><type>float4</type></entry>
6395 <entry>The number of distinct nonnull data values in the column.
6396 A value greater than zero is the actual number of distinct values.
6397 A value less than zero is the negative of a multiplier for the number
6398 of rows in the table; for example, a column in which about 80% of the
6399 values are nonnull and each nonnull value appears about twice on
6400 average could be represented by <structfield>stadistinct</structfield> = -0.4.
6401 A zero value means the number of distinct values is unknown.
6406 <entry><structfield>stakind<replaceable>N</replaceable></structfield></entry>
6407 <entry><type>int2</type></entry>
6410 A code number indicating the kind of statistics stored in the
6411 <replaceable>N</replaceable>th <quote>slot</quote> of the
6412 <structname>pg_statistic</structname> row.
6417 <entry><structfield>staop<replaceable>N</replaceable></structfield></entry>
6418 <entry><type>oid</type></entry>
6419 <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
6421 An operator used to derive the statistics stored in the
6422 <replaceable>N</replaceable>th <quote>slot</quote>. For example, a
6423 histogram slot would show the <literal><</literal> operator
6424 that defines the sort order of the data.
6429 <entry><structfield>stanumbers<replaceable>N</replaceable></structfield></entry>
6430 <entry><type>float4[]</type></entry>
6433 Numerical statistics of the appropriate kind for the
6434 <replaceable>N</replaceable>th <quote>slot</quote>, or null if the slot
6435 kind does not involve numerical values
6440 <entry><structfield>stavalues<replaceable>N</replaceable></structfield></entry>
6441 <entry><type>anyarray</type></entry>
6444 Column data values of the appropriate kind for the
6445 <replaceable>N</replaceable>th <quote>slot</quote>, or null if the slot
6446 kind does not store any data values. Each array's element
6447 values are actually of the specific column's data type, or a related
6448 type such as an array's element type, so there is no way to define
6449 these columns' type more specifically than <type>anyarray</type>.
6458 <sect1 id="catalog-pg-statistic-ext">
6459 <title><structname>pg_statistic_ext</structname></title>
6461 <indexterm zone="catalog-pg-statistic-ext">
6462 <primary>pg_statistic_ext</primary>
6466 The catalog <structname>pg_statistic_ext</structname>
6467 holds extended planner statistics.
6468 Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
6469 created with <xref linkend="sql-createstatistics"/>.
6473 <title><structname>pg_statistic_ext</structname> Columns</title>
6480 <entry>References</entry>
6481 <entry>Description</entry>
6488 <entry><structfield>stxrelid</structfield></entry>
6489 <entry><type>oid</type></entry>
6490 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6491 <entry>Table containing the columns described by this object</entry>
6495 <entry><structfield>stxname</structfield></entry>
6496 <entry><type>name</type></entry>
6498 <entry>Name of the statistics object</entry>
6502 <entry><structfield>stxnamespace</structfield></entry>
6503 <entry><type>oid</type></entry>
6504 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
6506 The OID of the namespace that contains this statistics object
6511 <entry><structfield>stxowner</structfield></entry>
6512 <entry><type>oid</type></entry>
6513 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
6514 <entry>Owner of the statistics object</entry>
6518 <entry><structfield>stxkeys</structfield></entry>
6519 <entry><type>int2vector</type></entry>
6520 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
6522 An array of attribute numbers, indicating which table columns are
6523 covered by this statistics object;
6524 for example a value of <literal>1 3</literal> would
6525 mean that the first and the third table columns are covered
6530 <entry><structfield>stxkind</structfield></entry>
6531 <entry><type>char[]</type></entry>
6534 An array containing codes for the enabled statistic kinds;
6536 <literal>d</literal> for n-distinct statistics,
6537 <literal>f</literal> for functional dependency statistics
6542 <entry><structfield>stxndistinct</structfield></entry>
6543 <entry><type>pg_ndistinct</type></entry>
6546 N-distinct counts, serialized as <structname>pg_ndistinct</structname> type
6551 <entry><structfield>stxdependencies</structfield></entry>
6552 <entry><type>pg_dependencies</type></entry>
6555 Functional dependency statistics, serialized
6556 as <structname>pg_dependencies</structname> type
6565 The <structfield>stxkind</structfield> field is filled at creation of the
6566 statistics object, indicating which statistic type(s) are desired.
6567 The fields after it are initially NULL and are filled only when the
6568 corresponding statistic has been computed by <command>ANALYZE</command>.
6572 <sect1 id="catalog-pg-subscription">
6573 <title><structname>pg_subscription</structname></title>
6575 <indexterm zone="catalog-pg-subscription">
6576 <primary>pg_subscription</primary>
6580 The catalog <structname>pg_subscription</structname> contains all existing
6581 logical replication subscriptions. For more information about logical
6582 replication see <xref linkend="logical-replication"/>.
6586 Unlike most system catalogs, <structname>pg_subscription</structname> is
6587 shared across all databases of a cluster: There is only one copy
6588 of <structname>pg_subscription</structname> per cluster, not one per
6593 Access to the column <structfield>subconninfo</structfield> is revoked from
6594 normal users, because it could contain plain-text passwords.
6598 <title><structname>pg_subscription</structname> Columns</title>
6605 <entry>References</entry>
6606 <entry>Description</entry>
6612 <entry><structfield>oid</structfield></entry>
6613 <entry><type>oid</type></entry>
6615 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
6619 <entry><structfield>subdbid</structfield></entry>
6620 <entry><type>oid</type></entry>
6621 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
6622 <entry>OID of the database which the subscription resides in</entry>
6626 <entry><structfield>subname</structfield></entry>
6627 <entry><type>name</type></entry>
6629 <entry>Name of the subscription</entry>
6633 <entry><structfield>subowner</structfield></entry>
6634 <entry><type>oid</type></entry>
6635 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
6636 <entry>Owner of the subscription</entry>
6640 <entry><structfield>subenabled</structfield></entry>
6641 <entry><type>bool</type></entry>
6643 <entry>If true, the subscription is enabled and should be replicating.</entry>
6647 <entry><structfield>subsynccommit</structfield></entry>
6648 <entry><type>text</type></entry>
6651 Contains the value of the <varname>synchronous_commit</varname>
6652 setting for the subscription workers.
6657 <entry><structfield>subconninfo</structfield></entry>
6658 <entry><type>text</type></entry>
6660 <entry>Connection string to the upstream database</entry>
6664 <entry><structfield>subslotname</structfield></entry>
6665 <entry><type>name</type></entry>
6667 <entry>Name of the replication slot in the upstream database. Also used
6668 for local replication origin name.</entry>
6672 <entry><structfield>subpublications</structfield></entry>
6673 <entry><type>text[]</type></entry>
6675 <entry>Array of subscribed publication names. These reference the
6676 publications on the publisher server. For more on publications
6677 see <xref linkend="logical-replication-publication"/>.
6685 <sect1 id="catalog-pg-subscription-rel">
6686 <title><structname>pg_subscription_rel</structname></title>
6688 <indexterm zone="catalog-pg-subscription-rel">
6689 <primary>pg_subscription_rel</primary>
6693 The catalog <structname>pg_subscription_rel</structname> contains the
6694 state for each replicated relation in each subscription. This is a
6695 many-to-many mapping.
6699 This catalog only contains tables known to the subscription after running
6700 either <command>CREATE SUBSCRIPTION</command> or
6701 <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command>.
6705 <title><structname>pg_subscription_rel</structname> Columns</title>
6712 <entry>References</entry>
6713 <entry>Description</entry>
6719 <entry><structfield>srsubid</structfield></entry>
6720 <entry><type>oid</type></entry>
6721 <entry><literal><link linkend="catalog-pg-subscription"><structname>pg_subscription</structname></link>.oid</literal></entry>
6722 <entry>Reference to subscription</entry>
6726 <entry><structfield>srrelid</structfield></entry>
6727 <entry><type>oid</type></entry>
6728 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6729 <entry>Reference to relation</entry>
6733 <entry><structfield>srsubstate</structfield></entry>
6734 <entry><type>char</type></entry>
6738 <literal>i</literal> = initialize,
6739 <literal>d</literal> = data is being copied,
6740 <literal>s</literal> = synchronized,
6741 <literal>r</literal> = ready (normal replication)
6746 <entry><structfield>srsublsn</structfield></entry>
6747 <entry><type>pg_lsn</type></entry>
6750 End LSN for <literal>s</literal> and <literal>r</literal> states.
6758 <sect1 id="catalog-pg-tablespace">
6759 <title><structname>pg_tablespace</structname></title>
6761 <indexterm zone="catalog-pg-tablespace">
6762 <primary>pg_tablespace</primary>
6766 The catalog <structname>pg_tablespace</structname> stores information
6767 about the available tablespaces. Tables can be placed in particular
6768 tablespaces to aid administration of disk layout.
6772 Unlike most system catalogs, <structname>pg_tablespace</structname>
6773 is shared across all databases of a cluster: there is only one
6774 copy of <structname>pg_tablespace</structname> per cluster, not
6779 <title><structname>pg_tablespace</structname> Columns</title>
6786 <entry>References</entry>
6787 <entry>Description</entry>
6793 <entry><structfield>oid</structfield></entry>
6794 <entry><type>oid</type></entry>
6796 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
6800 <entry><structfield>spcname</structfield></entry>
6801 <entry><type>name</type></entry>
6803 <entry>Tablespace name</entry>
6807 <entry><structfield>spcowner</structfield></entry>
6808 <entry><type>oid</type></entry>
6809 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
6810 <entry>Owner of the tablespace, usually the user who created it</entry>
6814 <entry><structfield>spcacl</structfield></entry>
6815 <entry><type>aclitem[]</type></entry>
6818 Access privileges; see
6819 <xref linkend="sql-grant"/> and
6820 <xref linkend="sql-revoke"/>
6826 <entry><structfield>spcoptions</structfield></entry>
6827 <entry><type>text[]</type></entry>
6830 Tablespace-level options, as <quote>keyword=value</quote> strings
6839 <sect1 id="catalog-pg-transform">
6840 <title><structname>pg_transform</structname></title>
6842 <indexterm zone="catalog-pg-transform">
6843 <primary>pg_transform</primary>
6847 The catalog <structname>pg_transform</structname> stores information about
6848 transforms, which are a mechanism to adapt data types to procedural
6849 languages. See <xref linkend="sql-createtransform"/> for more information.
6853 <title><structname>pg_transform</structname> Columns</title>
6860 <entry>References</entry>
6861 <entry>Description</entry>
6867 <entry><structfield>trftype</structfield></entry>
6868 <entry><type>oid</type></entry>
6869 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
6870 <entry>OID of the data type this transform is for</entry>
6874 <entry><structfield>trflang</structfield></entry>
6875 <entry><type>oid</type></entry>
6876 <entry><literal><link linkend="catalog-pg-language"><structname>pg_language</structname></link>.oid</literal></entry>
6877 <entry>OID of the language this transform is for</entry>
6881 <entry><structfield>trffromsql</structfield></entry>
6882 <entry><type>regproc</type></entry>
6883 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
6885 The OID of the function to use when converting the data type for input
6886 to the procedural language (e.g., function parameters). Zero is stored
6887 if this operation is not supported.
6892 <entry><structfield>trftosql</structfield></entry>
6893 <entry><type>regproc</type></entry>
6894 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
6896 The OID of the function to use when converting output from the
6897 procedural language (e.g., return values) to the data type. Zero is
6898 stored if this operation is not supported.
6907 <sect1 id="catalog-pg-trigger">
6908 <title><structname>pg_trigger</structname></title>
6910 <indexterm zone="catalog-pg-trigger">
6911 <primary>pg_trigger</primary>
6915 The catalog <structname>pg_trigger</structname> stores triggers on tables
6917 See <xref linkend="sql-createtrigger"/>
6918 for more information.
6922 <title><structname>pg_trigger</structname> Columns</title>
6929 <entry>References</entry>
6930 <entry>Description</entry>
6936 <entry><structfield>oid</structfield></entry>
6937 <entry><type>oid</type></entry>
6939 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
6943 <entry><structfield>tgrelid</structfield></entry>
6944 <entry><type>oid</type></entry>
6945 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6946 <entry>The table this trigger is on</entry>
6950 <entry><structfield>tgname</structfield></entry>
6951 <entry><type>name</type></entry>
6953 <entry>Trigger name (must be unique among triggers of same table)</entry>
6957 <entry><structfield>tgfoid</structfield></entry>
6958 <entry><type>oid</type></entry>
6959 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
6960 <entry>The function to be called</entry>
6964 <entry><structfield>tgtype</structfield></entry>
6965 <entry><type>int2</type></entry>
6967 <entry>Bit mask identifying trigger firing conditions</entry>
6971 <entry><structfield>tgenabled</structfield></entry>
6972 <entry><type>char</type></entry>
6975 Controls in which <xref linkend="guc-session-replication-role"/> modes
6977 <literal>O</literal> = trigger fires in <quote>origin</quote> and <quote>local</quote> modes,
6978 <literal>D</literal> = trigger is disabled,
6979 <literal>R</literal> = trigger fires in <quote>replica</quote> mode,
6980 <literal>A</literal> = trigger fires always.
6985 <entry><structfield>tgisinternal</structfield></entry>
6986 <entry><type>bool</type></entry>
6988 <entry>True if trigger is internally generated (usually, to enforce
6989 the constraint identified by <structfield>tgconstraint</structfield>)</entry>
6993 <entry><structfield>tgconstrrelid</structfield></entry>
6994 <entry><type>oid</type></entry>
6995 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
6996 <entry>The table referenced by a referential integrity constraint</entry>
7000 <entry><structfield>tgconstrindid</structfield></entry>
7001 <entry><type>oid</type></entry>
7002 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
7003 <entry>The index supporting a unique, primary key, referential integrity,
7004 or exclusion constraint</entry>
7008 <entry><structfield>tgconstraint</structfield></entry>
7009 <entry><type>oid</type></entry>
7010 <entry><literal><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.oid</literal></entry>
7011 <entry>The <structname>pg_constraint</structname> entry associated with the trigger, if any</entry>
7015 <entry><structfield>tgdeferrable</structfield></entry>
7016 <entry><type>bool</type></entry>
7018 <entry>True if constraint trigger is deferrable</entry>
7022 <entry><structfield>tginitdeferred</structfield></entry>
7023 <entry><type>bool</type></entry>
7025 <entry>True if constraint trigger is initially deferred</entry>
7029 <entry><structfield>tgnargs</structfield></entry>
7030 <entry><type>int2</type></entry>
7032 <entry>Number of argument strings passed to trigger function</entry>
7036 <entry><structfield>tgattr</structfield></entry>
7037 <entry><type>int2vector</type></entry>
7038 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
7039 <entry>Column numbers, if trigger is column-specific; otherwise an
7044 <entry><structfield>tgargs</structfield></entry>
7045 <entry><type>bytea</type></entry>
7047 <entry>Argument strings to pass to trigger, each NULL-terminated</entry>
7051 <entry><structfield>tgqual</structfield></entry>
7052 <entry><type>pg_node_tree</type></entry>
7054 <entry>Expression tree (in <function>nodeToString()</function>
7055 representation) for the trigger's <literal>WHEN</literal> condition, or null
7060 <entry><structfield>tgoldtable</structfield></entry>
7061 <entry><type>name</type></entry>
7063 <entry><literal>REFERENCING</literal> clause name for <literal>OLD TABLE</literal>,
7064 or null if none</entry>
7068 <entry><structfield>tgnewtable</structfield></entry>
7069 <entry><type>name</type></entry>
7071 <entry><literal>REFERENCING</literal> clause name for <literal>NEW TABLE</literal>,
7072 or null if none</entry>
7079 Currently, column-specific triggering is supported only for
7080 <literal>UPDATE</literal> events, and so <structfield>tgattr</structfield> is relevant
7081 only for that event type. <structfield>tgtype</structfield> might
7082 contain bits for other event types as well, but those are presumed
7083 to be table-wide regardless of what is in <structfield>tgattr</structfield>.
7088 When <structfield>tgconstraint</structfield> is nonzero,
7089 <structfield>tgconstrrelid</structfield>, <structfield>tgconstrindid</structfield>,
7090 <structfield>tgdeferrable</structfield>, and <structfield>tginitdeferred</structfield> are
7091 largely redundant with the referenced <structname>pg_constraint</structname> entry.
7092 However, it is possible for a non-deferrable trigger to be associated
7093 with a deferrable constraint: foreign key constraints can have some
7094 deferrable and some non-deferrable triggers.
7100 <literal>pg_class.relhastriggers</literal>
7101 must be true if a relation has any triggers in this catalog.
7108 <sect1 id="catalog-pg-ts-config">
7109 <title><structname>pg_ts_config</structname></title>
7111 <indexterm zone="catalog-pg-ts-config">
7112 <primary>pg_ts_config</primary>
7116 The <structname>pg_ts_config</structname> catalog contains entries
7117 representing text search configurations. A configuration specifies
7118 a particular text search parser and a list of dictionaries to use
7119 for each of the parser's output token types. The parser is shown
7120 in the <structname>pg_ts_config</structname> entry, but the
7121 token-to-dictionary mapping is defined by subsidiary entries in <link
7122 linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link>.
7126 <productname>PostgreSQL</productname>'s text search features are
7127 described at length in <xref linkend="textsearch"/>.
7131 <title><structname>pg_ts_config</structname> Columns</title>
7138 <entry>References</entry>
7139 <entry>Description</entry>
7145 <entry><structfield>oid</structfield></entry>
7146 <entry><type>oid</type></entry>
7148 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
7152 <entry><structfield>cfgname</structfield></entry>
7153 <entry><type>name</type></entry>
7155 <entry>Text search configuration name</entry>
7159 <entry><structfield>cfgnamespace</structfield></entry>
7160 <entry><type>oid</type></entry>
7161 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
7163 The OID of the namespace that contains this configuration
7168 <entry><structfield>cfgowner</structfield></entry>
7169 <entry><type>oid</type></entry>
7170 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
7171 <entry>Owner of the configuration</entry>
7175 <entry><structfield>cfgparser</structfield></entry>
7176 <entry><type>oid</type></entry>
7177 <entry><literal><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link>.oid</literal></entry>
7178 <entry>The OID of the text search parser for this configuration</entry>
7186 <sect1 id="catalog-pg-ts-config-map">
7187 <title><structname>pg_ts_config_map</structname></title>
7189 <indexterm zone="catalog-pg-ts-config-map">
7190 <primary>pg_ts_config_map</primary>
7194 The <structname>pg_ts_config_map</structname> catalog contains entries
7195 showing which text search dictionaries should be consulted, and in
7196 what order, for each output token type of each text search configuration's
7201 <productname>PostgreSQL</productname>'s text search features are
7202 described at length in <xref linkend="textsearch"/>.
7206 <title><structname>pg_ts_config_map</structname> Columns</title>
7213 <entry>References</entry>
7214 <entry>Description</entry>
7220 <entry><structfield>mapcfg</structfield></entry>
7221 <entry><type>oid</type></entry>
7222 <entry><literal><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link>.oid</literal></entry>
7223 <entry>The OID of the <structname>pg_ts_config</structname> entry owning this map entry</entry>
7227 <entry><structfield>maptokentype</structfield></entry>
7228 <entry><type>integer</type></entry>
7230 <entry>A token type emitted by the configuration's parser</entry>
7234 <entry><structfield>mapseqno</structfield></entry>
7235 <entry><type>integer</type></entry>
7237 <entry>Order in which to consult this entry (lower
7238 <structfield>mapseqno</structfield>s first)</entry>
7242 <entry><structfield>mapdict</structfield></entry>
7243 <entry><type>oid</type></entry>
7244 <entry><literal><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link>.oid</literal></entry>
7245 <entry>The OID of the text search dictionary to consult</entry>
7253 <sect1 id="catalog-pg-ts-dict">
7254 <title><structname>pg_ts_dict</structname></title>
7256 <indexterm zone="catalog-pg-ts-dict">
7257 <primary>pg_ts_dict</primary>
7261 The <structname>pg_ts_dict</structname> catalog contains entries
7262 defining text search dictionaries. A dictionary depends on a text
7263 search template, which specifies all the implementation functions
7264 needed; the dictionary itself provides values for the user-settable
7265 parameters supported by the template. This division of labor allows
7266 dictionaries to be created by unprivileged users. The parameters
7267 are specified by a text string <structfield>dictinitoption</structfield>,
7268 whose format and meaning vary depending on the template.
7272 <productname>PostgreSQL</productname>'s text search features are
7273 described at length in <xref linkend="textsearch"/>.
7277 <title><structname>pg_ts_dict</structname> Columns</title>
7284 <entry>References</entry>
7285 <entry>Description</entry>
7291 <entry><structfield>oid</structfield></entry>
7292 <entry><type>oid</type></entry>
7294 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
7298 <entry><structfield>dictname</structfield></entry>
7299 <entry><type>name</type></entry>
7301 <entry>Text search dictionary name</entry>
7305 <entry><structfield>dictnamespace</structfield></entry>
7306 <entry><type>oid</type></entry>
7307 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
7309 The OID of the namespace that contains this dictionary
7314 <entry><structfield>dictowner</structfield></entry>
7315 <entry><type>oid</type></entry>
7316 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
7317 <entry>Owner of the dictionary</entry>
7321 <entry><structfield>dicttemplate</structfield></entry>
7322 <entry><type>oid</type></entry>
7323 <entry><literal><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link>.oid</literal></entry>
7324 <entry>The OID of the text search template for this dictionary</entry>
7328 <entry><structfield>dictinitoption</structfield></entry>
7329 <entry><type>text</type></entry>
7331 <entry>Initialization option string for the template</entry>
7339 <sect1 id="catalog-pg-ts-parser">
7340 <title><structname>pg_ts_parser</structname></title>
7342 <indexterm zone="catalog-pg-ts-parser">
7343 <primary>pg_ts_parser</primary>
7347 The <structname>pg_ts_parser</structname> catalog contains entries
7348 defining text search parsers. A parser is responsible for splitting
7349 input text into lexemes and assigning a token type to each lexeme.
7350 Since a parser must be implemented by C-language-level functions,
7351 creation of new parsers is restricted to database superusers.
7355 <productname>PostgreSQL</productname>'s text search features are
7356 described at length in <xref linkend="textsearch"/>.
7360 <title><structname>pg_ts_parser</structname> Columns</title>
7367 <entry>References</entry>
7368 <entry>Description</entry>
7374 <entry><structfield>oid</structfield></entry>
7375 <entry><type>oid</type></entry>
7377 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
7381 <entry><structfield>prsname</structfield></entry>
7382 <entry><type>name</type></entry>
7384 <entry>Text search parser name</entry>
7388 <entry><structfield>prsnamespace</structfield></entry>
7389 <entry><type>oid</type></entry>
7390 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
7392 The OID of the namespace that contains this parser
7397 <entry><structfield>prsstart</structfield></entry>
7398 <entry><type>regproc</type></entry>
7399 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7400 <entry>OID of the parser's startup function</entry>
7404 <entry><structfield>prstoken</structfield></entry>
7405 <entry><type>regproc</type></entry>
7406 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7407 <entry>OID of the parser's next-token function</entry>
7411 <entry><structfield>prsend</structfield></entry>
7412 <entry><type>regproc</type></entry>
7413 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7414 <entry>OID of the parser's shutdown function</entry>
7418 <entry><structfield>prsheadline</structfield></entry>
7419 <entry><type>regproc</type></entry>
7420 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7421 <entry>OID of the parser's headline function</entry>
7425 <entry><structfield>prslextype</structfield></entry>
7426 <entry><type>regproc</type></entry>
7427 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7428 <entry>OID of the parser's lextype function</entry>
7436 <sect1 id="catalog-pg-ts-template">
7437 <title><structname>pg_ts_template</structname></title>
7439 <indexterm zone="catalog-pg-ts-template">
7440 <primary>pg_ts_template</primary>
7444 The <structname>pg_ts_template</structname> catalog contains entries
7445 defining text search templates. A template is the implementation
7446 skeleton for a class of text search dictionaries.
7447 Since a template must be implemented by C-language-level functions,
7448 creation of new templates is restricted to database superusers.
7452 <productname>PostgreSQL</productname>'s text search features are
7453 described at length in <xref linkend="textsearch"/>.
7457 <title><structname>pg_ts_template</structname> Columns</title>
7464 <entry>References</entry>
7465 <entry>Description</entry>
7471 <entry><structfield>oid</structfield></entry>
7472 <entry><type>oid</type></entry>
7474 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
7478 <entry><structfield>tmplname</structfield></entry>
7479 <entry><type>name</type></entry>
7481 <entry>Text search template name</entry>
7485 <entry><structfield>tmplnamespace</structfield></entry>
7486 <entry><type>oid</type></entry>
7487 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
7489 The OID of the namespace that contains this template
7494 <entry><structfield>tmplinit</structfield></entry>
7495 <entry><type>regproc</type></entry>
7496 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7497 <entry>OID of the template's initialization function</entry>
7501 <entry><structfield>tmpllexize</structfield></entry>
7502 <entry><type>regproc</type></entry>
7503 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7504 <entry>OID of the template's lexize function</entry>
7512 <sect1 id="catalog-pg-type">
7513 <title><structname>pg_type</structname></title>
7515 <indexterm zone="catalog-pg-type">
7516 <primary>pg_type</primary>
7520 The catalog <structname>pg_type</structname> stores information about data
7521 types. Base types and enum types (scalar types) are created with
7522 <xref linkend="sql-createtype"/>, and
7524 <xref linkend="sql-createdomain"/>.
7525 A composite type is automatically created for each table in the database, to
7526 represent the row structure of the table. It is also possible to create
7527 composite types with <command>CREATE TYPE AS</command>.
7531 <title><structname>pg_type</structname> Columns</title>
7538 <entry>References</entry>
7539 <entry>Description</entry>
7545 <entry><structfield>oid</structfield></entry>
7546 <entry><type>oid</type></entry>
7548 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
7552 <entry><structfield>typname</structfield></entry>
7553 <entry><type>name</type></entry>
7555 <entry>Data type name</entry>
7559 <entry><structfield>typnamespace</structfield></entry>
7560 <entry><type>oid</type></entry>
7561 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
7563 The OID of the namespace that contains this type
7568 <entry><structfield>typowner</structfield></entry>
7569 <entry><type>oid</type></entry>
7570 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
7571 <entry>Owner of the type</entry>
7575 <entry><structfield>typlen</structfield></entry>
7576 <entry><type>int2</type></entry>
7579 For a fixed-size type, <structfield>typlen</structfield> is the number
7580 of bytes in the internal representation of the type. But for a
7581 variable-length type, <structfield>typlen</structfield> is negative.
7582 -1 indicates a <quote>varlena</quote> type (one that has a length word),
7583 -2 indicates a null-terminated C string.
7588 <entry><structfield>typbyval</structfield></entry>
7589 <entry><type>bool</type></entry>
7592 <structfield>typbyval</structfield> determines whether internal
7593 routines pass a value of this type by value or by reference.
7594 <structfield>typbyval</structfield> had better be false if
7595 <structfield>typlen</structfield> is not 1, 2, or 4 (or 8 on machines
7596 where Datum is 8 bytes).
7597 Variable-length types are always passed by reference. Note that
7598 <structfield>typbyval</structfield> can be false even if the
7599 length would allow pass-by-value.
7604 <entry><structfield>typtype</structfield></entry>
7605 <entry><type>char</type></entry>
7608 <structfield>typtype</structfield> is
7609 <literal>b</literal> for a base type,
7610 <literal>c</literal> for a composite type (e.g., a table's row type),
7611 <literal>d</literal> for a domain,
7612 <literal>e</literal> for an enum type,
7613 <literal>p</literal> for a pseudo-type, or
7614 <literal>r</literal> for a range type.
7615 See also <structfield>typrelid</structfield> and
7616 <structfield>typbasetype</structfield>.
7621 <entry><structfield>typcategory</structfield></entry>
7622 <entry><type>char</type></entry>
7625 <structfield>typcategory</structfield> is an arbitrary classification
7626 of data types that is used by the parser to determine which implicit
7627 casts should be <quote>preferred</quote>.
7628 See <xref linkend="catalog-typcategory-table"/>.
7633 <entry><structfield>typispreferred</structfield></entry>
7634 <entry><type>bool</type></entry>
7637 True if the type is a preferred cast target within its
7638 <structfield>typcategory</structfield>
7643 <entry><structfield>typisdefined</structfield></entry>
7644 <entry><type>bool</type></entry>
7647 True if the type is defined, false if this is a placeholder
7648 entry for a not-yet-defined type. When
7649 <structfield>typisdefined</structfield> is false, nothing
7650 except the type name, namespace, and OID can be relied on.
7655 <entry><structfield>typdelim</structfield></entry>
7656 <entry><type>char</type></entry>
7659 Character that separates two values of this type when parsing
7660 array input. Note that the delimiter is associated with the array
7661 element data type, not the array data type.
7666 <entry><structfield>typrelid</structfield></entry>
7667 <entry><type>oid</type></entry>
7668 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
7670 If this is a composite type (see
7671 <structfield>typtype</structfield>), then this column points to
7672 the <structname>pg_class</structname> entry that defines the
7673 corresponding table. (For a free-standing composite type, the
7674 <structname>pg_class</structname> entry doesn't really represent
7675 a table, but it is needed anyway for the type's
7676 <structname>pg_attribute</structname> entries to link to.)
7677 Zero for non-composite types.
7682 <entry><structfield>typelem</structfield></entry>
7683 <entry><type>oid</type></entry>
7684 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
7686 If <structfield>typelem</structfield> is not 0 then it
7687 identifies another row in <structname>pg_type</structname>.
7688 The current type can then be subscripted like an array yielding
7689 values of type <structfield>typelem</structfield>. A
7690 <quote>true</quote> array type is variable length
7691 (<structfield>typlen</structfield> = -1),
7692 but some fixed-length (<structfield>typlen</structfield> > 0) types
7693 also have nonzero <structfield>typelem</structfield>, for example
7694 <type>name</type> and <type>point</type>.
7695 If a fixed-length type has a <structfield>typelem</structfield> then
7696 its internal representation must be some number of values of the
7697 <structfield>typelem</structfield> data type with no other data.
7698 Variable-length array types have a header defined by the array
7704 <entry><structfield>typarray</structfield></entry>
7705 <entry><type>oid</type></entry>
7706 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
7708 If <structfield>typarray</structfield> is not 0 then it
7709 identifies another row in <structname>pg_type</structname>, which
7710 is the <quote>true</quote> array type having this type as element
7715 <entry><structfield>typinput</structfield></entry>
7716 <entry><type>regproc</type></entry>
7717 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7718 <entry>Input conversion function (text format)</entry>
7722 <entry><structfield>typoutput</structfield></entry>
7723 <entry><type>regproc</type></entry>
7724 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7725 <entry>Output conversion function (text format)</entry>
7729 <entry><structfield>typreceive</structfield></entry>
7730 <entry><type>regproc</type></entry>
7731 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7732 <entry>Input conversion function (binary format), or 0 if none</entry>
7736 <entry><structfield>typsend</structfield></entry>
7737 <entry><type>regproc</type></entry>
7738 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7739 <entry>Output conversion function (binary format), or 0 if none</entry>
7743 <entry><structfield>typmodin</structfield></entry>
7744 <entry><type>regproc</type></entry>
7745 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7746 <entry>Type modifier input function, or 0 if type does not support modifiers</entry>
7750 <entry><structfield>typmodout</structfield></entry>
7751 <entry><type>regproc</type></entry>
7752 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7753 <entry>Type modifier output function, or 0 to use the standard format</entry>
7757 <entry><structfield>typanalyze</structfield></entry>
7758 <entry><type>regproc</type></entry>
7759 <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
7760 <entry>Custom <command>ANALYZE</command> function, or 0 to use the standard function</entry>
7764 <entry><structfield>typalign</structfield></entry>
7765 <entry><type>char</type></entry>
7769 <structfield>typalign</structfield> is the alignment required
7770 when storing a value of this type. It applies to storage on
7771 disk as well as most representations of the value inside
7772 <productname>PostgreSQL</productname>.
7773 When multiple values are stored consecutively, such
7774 as in the representation of a complete row on disk, padding is
7775 inserted before a datum of this type so that it begins on the
7776 specified boundary. The alignment reference is the beginning
7777 of the first datum in the sequence.
7781 Possible values are:
7784 <para><literal>c</literal> = <type>char</type> alignment, i.e., no alignment needed.</para>
7787 <para><literal>s</literal> = <type>short</type> alignment (2 bytes on most machines).</para>
7790 <para><literal>i</literal> = <type>int</type> alignment (4 bytes on most machines).</para>
7793 <para><literal>d</literal> = <type>double</type> alignment (8 bytes on many machines, but by no means all).</para>
7798 For types used in system tables, it is critical that the size
7799 and alignment defined in <structname>pg_type</structname>
7800 agree with the way that the compiler will lay out the column in
7801 a structure representing a table row.
7807 <entry><structfield>typstorage</structfield></entry>
7808 <entry><type>char</type></entry>
7811 <structfield>typstorage</structfield> tells for varlena
7812 types (those with <structfield>typlen</structfield> = -1) if
7813 the type is prepared for toasting and what the default strategy
7814 for attributes of this type should be.
7818 <para><literal>p</literal>: Value must always be stored plain.</para>
7822 <literal>e</literal>: Value can be stored in a <quote>secondary</quote>
7823 relation (if relation has one, see
7824 <literal>pg_class.reltoastrelid</literal>).
7828 <para><literal>m</literal>: Value can be stored compressed inline.</para>
7831 <para><literal>x</literal>: Value can be stored compressed inline or stored in <quote>secondary</quote> storage.</para>
7834 Note that <literal>m</literal> columns can also be moved out to secondary
7835 storage, but only as a last resort (<literal>e</literal> and <literal>x</literal> columns are
7841 <entry><structfield>typnotnull</structfield></entry>
7842 <entry><type>bool</type></entry>
7845 <structfield>typnotnull</structfield> represents a not-null
7846 constraint on a type. Used for domains only.
7851 <entry><structfield>typbasetype</structfield></entry>
7852 <entry><type>oid</type></entry>
7853 <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
7855 If this is a domain (see <structfield>typtype</structfield>), then
7856 <structfield>typbasetype</structfield> identifies the type that this
7857 one is based on. Zero if this type is not a domain.
7862 <entry><structfield>typtypmod</structfield></entry>
7863 <entry><type>int4</type></entry>
7866 Domains use <structfield>typtypmod</structfield> to record the <literal>typmod</literal>
7867 to be applied to their base type (-1 if base type does not use a
7868 <literal>typmod</literal>). -1 if this type is not a domain.
7873 <entry><structfield>typndims</structfield></entry>
7874 <entry><type>int4</type></entry>
7877 <structfield>typndims</structfield> is the number of array dimensions
7878 for a domain over an array (that is, <structfield>typbasetype</structfield> is
7880 Zero for types other than domains over array types.
7885 <entry><structfield>typcollation</structfield></entry>
7886 <entry><type>oid</type></entry>
7887 <entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
7889 <structfield>typcollation</structfield> specifies the collation
7890 of the type. If the type does not support collations, this will
7891 be zero. A base type that supports collations will have
7892 <symbol>DEFAULT_COLLATION_OID</symbol> here. A domain over a
7893 collatable type can have some other collation OID, if one was
7894 specified for the domain.
7899 <entry><structfield>typdefaultbin</structfield></entry>
7900 <entry><type>pg_node_tree</type></entry>
7903 If <structfield>typdefaultbin</structfield> is not null, it is the
7904 <function>nodeToString()</function>
7905 representation of a default expression for the type. This is
7906 only used for domains.
7911 <entry><structfield>typdefault</structfield></entry>
7912 <entry><type>text</type></entry>
7915 <structfield>typdefault</structfield> is null if the type has no associated
7916 default value. If <structfield>typdefaultbin</structfield> is not null,
7917 <structfield>typdefault</structfield> must contain a human-readable version of the
7918 default expression represented by <structfield>typdefaultbin</structfield>. If
7919 <structfield>typdefaultbin</structfield> is null and <structfield>typdefault</structfield> is
7920 not, then <structfield>typdefault</structfield> is the external representation of
7921 the type's default value, which can be fed to the type's input
7922 converter to produce a constant.
7927 <entry><structfield>typacl</structfield></entry>
7928 <entry><type>aclitem[]</type></entry>
7931 Access privileges; see
7932 <xref linkend="sql-grant"/> and
7933 <xref linkend="sql-revoke"/>
7942 <xref linkend="catalog-typcategory-table"/> lists the system-defined values
7943 of <structfield>typcategory</structfield>. Any future additions to this list will
7944 also be upper-case ASCII letters. All other ASCII characters are reserved
7945 for user-defined categories.
7948 <table id="catalog-typcategory-table">
7949 <title><structfield>typcategory</structfield> Codes</title>
7955 <entry>Category</entry>
7961 <entry><literal>A</literal></entry>
7962 <entry>Array types</entry>
7965 <entry><literal>B</literal></entry>
7966 <entry>Boolean types</entry>
7969 <entry><literal>C</literal></entry>
7970 <entry>Composite types</entry>
7973 <entry><literal>D</literal></entry>
7974 <entry>Date/time types</entry>
7977 <entry><literal>E</literal></entry>
7978 <entry>Enum types</entry>
7981 <entry><literal>G</literal></entry>
7982 <entry>Geometric types</entry>
7985 <entry><literal>I</literal></entry>
7986 <entry>Network address types</entry>
7989 <entry><literal>N</literal></entry>
7990 <entry>Numeric types</entry>
7993 <entry><literal>P</literal></entry>
7994 <entry>Pseudo-types</entry>
7997 <entry><literal>R</literal></entry>
7998 <entry>Range types</entry>
8001 <entry><literal>S</literal></entry>
8002 <entry>String types</entry>
8005 <entry><literal>T</literal></entry>
8006 <entry>Timespan types</entry>
8009 <entry><literal>U</literal></entry>
8010 <entry>User-defined types</entry>
8013 <entry><literal>V</literal></entry>
8014 <entry>Bit-string types</entry>
8017 <entry><literal>X</literal></entry>
8018 <entry><type>unknown</type> type</entry>
8027 <sect1 id="catalog-pg-user-mapping">
8028 <title><structname>pg_user_mapping</structname></title>
8030 <indexterm zone="catalog-pg-user-mapping">
8031 <primary>pg_user_mapping</primary>
8035 The catalog <structname>pg_user_mapping</structname> stores
8036 the mappings from local user to remote. Access to this catalog is
8037 restricted from normal users, use the view
8038 <link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link>
8043 <title><structname>pg_user_mapping</structname> Columns</title>
8050 <entry>References</entry>
8051 <entry>Description</entry>
8057 <entry><structfield>oid</structfield></entry>
8058 <entry><type>oid</type></entry>
8060 <entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
8064 <entry><structfield>umuser</structfield></entry>
8065 <entry><type>oid</type></entry>
8066 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
8067 <entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
8071 <entry><structfield>umserver</structfield></entry>
8072 <entry><type>oid</type></entry>
8073 <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
8075 The OID of the foreign server that contains this mapping
8080 <entry><structfield>umoptions</structfield></entry>
8081 <entry><type>text[]</type></entry>
8084 User mapping specific options, as <quote>keyword=value</quote> strings
8093 <sect1 id="views-overview">
8094 <title>System Views</title>
8097 In addition to the system catalogs, <productname>PostgreSQL</productname>
8098 provides a number of built-in views. Some system views provide convenient
8099 access to some commonly used queries on the system catalogs. Other views
8100 provide access to internal server state.
8104 The information schema (<xref linkend="information-schema"/>) provides
8105 an alternative set of views which overlap the functionality of the system
8106 views. Since the information schema is SQL-standard whereas the views
8107 described here are <productname>PostgreSQL</productname>-specific,
8108 it's usually better to use the information schema if it provides all
8109 the information you need.
8113 <xref linkend="view-table"/> lists the system views described here.
8114 More detailed documentation of each view follows below.
8115 There are some additional views that provide access to the results of
8116 the statistics collector; they are described in <xref
8117 linkend="monitoring-stats-views-table"/>.
8121 Except where noted, all the views described here are read-only.
8124 <table id="view-table">
8125 <title>System Views</title>
8130 <entry>View Name</entry>
8131 <entry>Purpose</entry>
8137 <entry><link linkend="view-pg-available-extensions"><structname>pg_available_extensions</structname></link></entry>
8138 <entry>available extensions</entry>
8142 <entry><link linkend="view-pg-available-extension-versions"><structname>pg_available_extension_versions</structname></link></entry>
8143 <entry>available versions of extensions</entry>
8147 <entry><link linkend="view-pg-config"><structname>pg_config</structname></link></entry>
8148 <entry>compile-time configuration parameters</entry>
8152 <entry><link linkend="view-pg-cursors"><structname>pg_cursors</structname></link></entry>
8153 <entry>open cursors</entry>
8157 <entry><link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link></entry>
8158 <entry>summary of configuration file contents</entry>
8162 <entry><link linkend="view-pg-group"><structname>pg_group</structname></link></entry>
8163 <entry>groups of database users</entry>
8167 <entry><link linkend="view-pg-hba-file-rules"><structname>pg_hba_file_rules</structname></link></entry>
8168 <entry>summary of client authentication configuration file contents</entry>
8172 <entry><link linkend="view-pg-indexes"><structname>pg_indexes</structname></link></entry>
8173 <entry>indexes</entry>
8177 <entry><link linkend="view-pg-locks"><structname>pg_locks</structname></link></entry>
8178 <entry>locks currently held or awaited</entry>
8182 <entry><link linkend="view-pg-matviews"><structname>pg_matviews</structname></link></entry>
8183 <entry>materialized views</entry>
8187 <entry><link linkend="view-pg-policies"><structname>pg_policies</structname></link></entry>
8188 <entry>policies</entry>
8192 <entry><link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link></entry>
8193 <entry>prepared statements</entry>
8197 <entry><link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link></entry>
8198 <entry>prepared transactions</entry>
8202 <entry><link linkend="view-pg-publication-tables"><structname>pg_publication_tables</structname></link></entry>
8203 <entry>publications and their associated tables</entry>
8207 <entry><link linkend="view-pg-replication-origin-status"><structname>pg_replication_origin_status</structname></link></entry>
8208 <entry>information about replication origins, including replication progress</entry>
8212 <entry><link linkend="view-pg-replication-slots"><structname>pg_replication_slots</structname></link></entry>
8213 <entry>replication slot information</entry>
8217 <entry><link linkend="view-pg-roles"><structname>pg_roles</structname></link></entry>
8218 <entry>database roles</entry>
8222 <entry><link linkend="view-pg-rules"><structname>pg_rules</structname></link></entry>
8223 <entry>rules</entry>
8227 <entry><link linkend="view-pg-seclabels"><structname>pg_seclabels</structname></link></entry>
8228 <entry>security labels</entry>
8232 <entry><link linkend="view-pg-sequences"><structname>pg_sequences</structname></link></entry>
8233 <entry>sequences</entry>
8237 <entry><link linkend="view-pg-settings"><structname>pg_settings</structname></link></entry>
8238 <entry>parameter settings</entry>
8242 <entry><link linkend="view-pg-shadow"><structname>pg_shadow</structname></link></entry>
8243 <entry>database users</entry>
8247 <entry><link linkend="view-pg-stats"><structname>pg_stats</structname></link></entry>
8248 <entry>planner statistics</entry>
8252 <entry><link linkend="view-pg-tables"><structname>pg_tables</structname></link></entry>
8253 <entry>tables</entry>
8257 <entry><link linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link></entry>
8258 <entry>time zone abbreviations</entry>
8262 <entry><link linkend="view-pg-timezone-names"><structname>pg_timezone_names</structname></link></entry>
8263 <entry>time zone names</entry>
8267 <entry><link linkend="view-pg-user"><structname>pg_user</structname></link></entry>
8268 <entry>database users</entry>
8272 <entry><link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link></entry>
8273 <entry>user mappings</entry>
8277 <entry><link linkend="view-pg-views"><structname>pg_views</structname></link></entry>
8278 <entry>views</entry>
8286 <sect1 id="view-pg-available-extensions">
8287 <title><structname>pg_available_extensions</structname></title>
8289 <indexterm zone="view-pg-available-extensions">
8290 <primary>pg_available_extensions</primary>
8294 The <structname>pg_available_extensions</structname> view lists the
8295 extensions that are available for installation.
8297 <link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
8298 catalog, which shows the extensions currently installed.
8302 <title><structname>pg_available_extensions</structname> Columns</title>
8309 <entry>Description</entry>
8315 <entry><structfield>name</structfield></entry>
8316 <entry><type>name</type></entry>
8317 <entry>Extension name</entry>
8321 <entry><structfield>default_version</structfield></entry>
8322 <entry><type>text</type></entry>
8323 <entry>Name of default version, or <literal>NULL</literal> if none is
8328 <entry><structfield>installed_version</structfield></entry>
8329 <entry><type>text</type></entry>
8330 <entry>Currently installed version of the extension,
8331 or <literal>NULL</literal> if not installed</entry>
8335 <entry><structfield>comment</structfield></entry>
8336 <entry><type>text</type></entry>
8337 <entry>Comment string from the extension's control file</entry>
8344 The <structname>pg_available_extensions</structname> view is read only.
8348 <sect1 id="view-pg-available-extension-versions">
8349 <title><structname>pg_available_extension_versions</structname></title>
8351 <indexterm zone="view-pg-available-extension-versions">
8352 <primary>pg_available_extension_versions</primary>
8356 The <structname>pg_available_extension_versions</structname> view lists the
8357 specific extension versions that are available for installation.
8359 linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
8360 catalog, which shows the extensions currently installed.
8364 <title><structname>pg_available_extension_versions</structname> Columns</title>
8371 <entry>Description</entry>
8377 <entry><structfield>name</structfield></entry>
8378 <entry><type>name</type></entry>
8379 <entry>Extension name</entry>
8383 <entry><structfield>version</structfield></entry>
8384 <entry><type>text</type></entry>
8385 <entry>Version name</entry>
8389 <entry><structfield>installed</structfield></entry>
8390 <entry><type>bool</type></entry>
8391 <entry>True if this version of this extension is currently
8396 <entry><structfield>superuser</structfield></entry>
8397 <entry><type>bool</type></entry>
8398 <entry>True if only superusers are allowed to install this extension</entry>
8402 <entry><structfield>relocatable</structfield></entry>
8403 <entry><type>bool</type></entry>
8404 <entry>True if extension can be relocated to another schema</entry>
8408 <entry><structfield>schema</structfield></entry>
8409 <entry><type>name</type></entry>
8410 <entry>Name of the schema that the extension must be installed into,
8411 or <literal>NULL</literal> if partially or fully relocatable</entry>
8415 <entry><structfield>requires</structfield></entry>
8416 <entry><type>name[]</type></entry>
8417 <entry>Names of prerequisite extensions,
8418 or <literal>NULL</literal> if none</entry>
8422 <entry><structfield>comment</structfield></entry>
8423 <entry><type>text</type></entry>
8424 <entry>Comment string from the extension's control file</entry>
8431 The <structname>pg_available_extension_versions</structname> view is read
8436 <sect1 id="view-pg-config">
8437 <title><structname>pg_config</structname></title>
8439 <indexterm zone="view-pg-config">
8440 <primary>pg_config</primary>
8444 The view <structname>pg_config</structname> describes the
8445 compile-time configuration parameters of the currently installed
8446 version of <productname>PostgreSQL</productname>. It is intended, for example, to
8447 be used by software packages that want to interface to
8448 <productname>PostgreSQL</productname> to facilitate finding the required header
8449 files and libraries. It provides the same basic information as the
8450 <xref linkend="app-pgconfig"/> <productname>PostgreSQL</productname> client
8455 By default, the <structname>pg_config</structname> view can be read
8460 <title><structname>pg_config</structname> Columns</title>
8466 <entry>Description</entry>
8472 <entry><structfield>name</structfield></entry>
8473 <entry><type>text</type></entry>
8474 <entry>The parameter name</entry>
8478 <entry><structfield>setting</structfield></entry>
8479 <entry><type>text</type></entry>
8480 <entry>The parameter value</entry>
8488 <sect1 id="view-pg-cursors">
8489 <title><structname>pg_cursors</structname></title>
8491 <indexterm zone="view-pg-cursors">
8492 <primary>pg_cursors</primary>
8496 The <structname>pg_cursors</structname> view lists the cursors that
8497 are currently available. Cursors can be defined in several ways:
8501 via the <xref linkend="sql-declare"/>
8508 via the Bind message in the frontend/backend protocol, as
8509 described in <xref linkend="protocol-flow-ext-query"/>
8515 via the Server Programming Interface (SPI), as described in
8516 <xref linkend="spi-interface"/>
8521 The <structname>pg_cursors</structname> view displays cursors
8522 created by any of these means. Cursors only exist for the duration
8523 of the transaction that defines them, unless they have been
8524 declared <literal>WITH HOLD</literal>. Therefore non-holdable
8525 cursors are only present in the view until the end of their
8526 creating transaction.
8530 Cursors are used internally to implement some of the components
8531 of <productname>PostgreSQL</productname>, such as procedural languages.
8532 Therefore, the <structname>pg_cursors</structname> view might include cursors
8533 that have not been explicitly created by the user.
8539 <title><structname>pg_cursors</structname> Columns</title>
8546 <entry>Description</entry>
8552 <entry><structfield>name</structfield></entry>
8553 <entry><type>text</type></entry>
8554 <entry>The name of the cursor</entry>
8558 <entry><structfield>statement</structfield></entry>
8559 <entry><type>text</type></entry>
8560 <entry>The verbatim query string submitted to declare this cursor</entry>
8564 <entry><structfield>is_holdable</structfield></entry>
8565 <entry><type>boolean</type></entry>
8567 <literal>true</literal> if the cursor is holdable (that is, it
8568 can be accessed after the transaction that declared the cursor
8569 has committed); <literal>false</literal> otherwise
8574 <entry><structfield>is_binary</structfield></entry>
8575 <entry><type>boolean</type></entry>
8577 <literal>true</literal> if the cursor was declared
8578 <literal>BINARY</literal>; <literal>false</literal>
8584 <entry><structfield>is_scrollable</structfield></entry>
8585 <entry><type>boolean</type></entry>
8587 <literal>true</literal> if the cursor is scrollable (that is, it
8588 allows rows to be retrieved in a nonsequential manner);
8589 <literal>false</literal> otherwise
8594 <entry><structfield>creation_time</structfield></entry>
8595 <entry><type>timestamptz</type></entry>
8596 <entry>The time at which the cursor was declared</entry>
8603 The <structname>pg_cursors</structname> view is read only.
8608 <sect1 id="view-pg-file-settings">
8609 <title><structname>pg_file_settings</structname></title>
8611 <indexterm zone="view-pg-file-settings">
8612 <primary>pg_file_settings</primary>
8616 The view <structname>pg_file_settings</structname> provides a summary of
8617 the contents of the server's configuration file(s). A row appears in
8618 this view for each <quote>name = value</quote> entry appearing in the files,
8619 with annotations indicating whether the value could be applied
8620 successfully. Additional row(s) may appear for problems not linked to
8621 a <quote>name = value</quote> entry, such as syntax errors in the files.
8625 This view is helpful for checking whether planned changes in the
8626 configuration files will work, or for diagnosing a previous failure.
8627 Note that this view reports on the <emphasis>current</emphasis> contents of the
8628 files, not on what was last applied by the server. (The
8629 <link linkend="view-pg-settings"><structname>pg_settings</structname></link>
8630 view is usually sufficient to determine that.)
8634 By default, the <structname>pg_file_settings</structname> view can be read
8639 <title><structname>pg_file_settings</structname> Columns</title>
8646 <entry>Description</entry>
8651 <entry><structfield>sourcefile</structfield></entry>
8652 <entry><structfield>text</structfield></entry>
8653 <entry>Full path name of the configuration file</entry>
8656 <entry><structfield>sourceline</structfield></entry>
8657 <entry><structfield>integer</structfield></entry>
8659 Line number within the configuration file where the entry appears
8663 <entry><structfield>seqno</structfield></entry>
8664 <entry><structfield>integer</structfield></entry>
8665 <entry>Order in which the entries are processed (1..<replaceable>n</replaceable>)</entry>
8668 <entry><structfield>name</structfield></entry>
8669 <entry><structfield>text</structfield></entry>
8670 <entry>Configuration parameter name</entry>
8673 <entry><structfield>setting</structfield></entry>
8674 <entry><structfield>text</structfield></entry>
8675 <entry>Value to be assigned to the parameter</entry>
8678 <entry><structfield>applied</structfield></entry>
8679 <entry><structfield>boolean</structfield></entry>
8680 <entry>True if the value can be applied successfully</entry>
8683 <entry><structfield>error</structfield></entry>
8684 <entry><structfield>text</structfield></entry>
8685 <entry>If not null, an error message indicating why this entry could
8686 not be applied</entry>
8693 If the configuration file contains syntax errors or invalid parameter
8694 names, the server will not attempt to apply any settings from it, and
8695 therefore all the <structfield>applied</structfield> fields will read as false.
8696 In such a case there will be one or more rows with
8697 non-null <structfield>error</structfield> fields indicating the
8698 problem(s). Otherwise, individual settings will be applied if possible.
8699 If an individual setting cannot be applied (e.g., invalid value, or the
8700 setting cannot be changed after server start) it will have an appropriate
8701 message in the <structfield>error</structfield> field. Another way that
8702 an entry might have <structfield>applied</structfield> = false is that it is
8703 overridden by a later entry for the same parameter name; this case is not
8704 considered an error so nothing appears in
8705 the <structfield>error</structfield> field.
8709 See <xref linkend="config-setting"/> for more information about the various
8710 ways to change run-time parameters.
8715 <sect1 id="view-pg-group">
8716 <title><structname>pg_group</structname></title>
8718 <indexterm zone="view-pg-group">
8719 <primary>pg_group</primary>
8723 The view <structname>pg_group</structname> exists for backwards
8724 compatibility: it emulates a catalog that existed in
8725 <productname>PostgreSQL</productname> before version 8.1.
8726 It shows the names and members of all roles that are marked as not
8727 <structfield>rolcanlogin</structfield>, which is an approximation to the set
8728 of roles that are being used as groups.
8732 <title><structname>pg_group</structname> Columns</title>
8739 <entry>References</entry>
8740 <entry>Description</entry>
8746 <entry><structfield>groname</structfield></entry>
8747 <entry><type>name</type></entry>
8748 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
8749 <entry>Name of the group</entry>
8753 <entry><structfield>grosysid</structfield></entry>
8754 <entry><type>oid</type></entry>
8755 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
8756 <entry>ID of this group</entry>
8760 <entry><structfield>grolist</structfield></entry>
8761 <entry><type>oid[]</type></entry>
8762 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
8763 <entry>An array containing the IDs of the roles in this group</entry>
8771 <sect1 id="view-pg-hba-file-rules">
8772 <title><structname>pg_hba_file_rules</structname></title>
8774 <indexterm zone="view-pg-hba-file-rules">
8775 <primary>pg_hba_file_rules</primary>
8779 The view <structname>pg_hba_file_rules</structname> provides a summary of
8780 the contents of the client authentication configuration
8781 file, <filename>pg_hba.conf</filename>. A row appears in this view for each
8782 non-empty, non-comment line in the file, with annotations indicating
8783 whether the rule could be applied successfully.
8787 This view can be helpful for checking whether planned changes in the
8788 authentication configuration file will work, or for diagnosing a previous
8789 failure. Note that this view reports on the <emphasis>current</emphasis> contents
8790 of the file, not on what was last loaded by the server.
8794 By default, the <structname>pg_hba_file_rules</structname> view can be read
8799 <title><structname>pg_hba_file_rules</structname> Columns</title>
8806 <entry>Description</entry>
8811 <entry><structfield>line_number</structfield></entry>
8812 <entry><structfield>integer</structfield></entry>
8814 Line number of this rule in <filename>pg_hba.conf</filename>
8818 <entry><structfield>type</structfield></entry>
8819 <entry><structfield>text</structfield></entry>
8820 <entry>Type of connection</entry>
8823 <entry><structfield>database</structfield></entry>
8824 <entry><structfield>text[]</structfield></entry>
8825 <entry>List of database name(s) to which this rule applies</entry>
8828 <entry><structfield>user_name</structfield></entry>
8829 <entry><structfield>text[]</structfield></entry>
8830 <entry>List of user and group name(s) to which this rule applies</entry>
8833 <entry><structfield>address</structfield></entry>
8834 <entry><structfield>text</structfield></entry>
8836 Host name or IP address, or one
8837 of <literal>all</literal>, <literal>samehost</literal>,
8838 or <literal>samenet</literal>, or null for local connections
8842 <entry><structfield>netmask</structfield></entry>
8843 <entry><structfield>text</structfield></entry>
8844 <entry>IP address mask, or null if not applicable</entry>
8847 <entry><structfield>auth_method</structfield></entry>
8848 <entry><type>text</type></entry>
8849 <entry>Authentication method</entry>
8852 <entry><structfield>options</structfield></entry>
8853 <entry><type>text[]</type></entry>
8854 <entry>Options specified for authentication method, if any</entry>
8857 <entry><structfield>error</structfield></entry>
8858 <entry><structfield>text</structfield></entry>
8860 If not null, an error message indicating why this
8861 line could not be processed
8869 Usually, a row reflecting an incorrect entry will have values for only
8870 the <structfield>line_number</structfield> and <structfield>error</structfield> fields.
8874 See <xref linkend="client-authentication"/> for more information about
8875 client authentication configuration.
8879 <sect1 id="view-pg-indexes">
8880 <title><structname>pg_indexes</structname></title>
8882 <indexterm zone="view-pg-indexes">
8883 <primary>pg_indexes</primary>
8887 The view <structname>pg_indexes</structname> provides access to
8888 useful information about each index in the database.
8892 <title><structname>pg_indexes</structname> Columns</title>
8899 <entry>References</entry>
8900 <entry>Description</entry>
8905 <entry><structfield>schemaname</structfield></entry>
8906 <entry><type>name</type></entry>
8907 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
8908 <entry>Name of schema containing table and index</entry>
8911 <entry><structfield>tablename</structfield></entry>
8912 <entry><type>name</type></entry>
8913 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
8914 <entry>Name of table the index is for</entry>
8917 <entry><structfield>indexname</structfield></entry>
8918 <entry><type>name</type></entry>
8919 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
8920 <entry>Name of index</entry>
8923 <entry><structfield>tablespace</structfield></entry>
8924 <entry><type>name</type></entry>
8925 <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
8926 <entry>Name of tablespace containing index (null if default for database)</entry>
8929 <entry><structfield>indexdef</structfield></entry>
8930 <entry><type>text</type></entry>
8932 <entry>Index definition (a reconstructed <command>CREATE INDEX</command>
8941 <sect1 id="view-pg-locks">
8942 <title><structname>pg_locks</structname></title>
8944 <indexterm zone="view-pg-locks">
8945 <primary>pg_locks</primary>
8949 The view <structname>pg_locks</structname> provides access to
8950 information about the locks held by active processes within the
8951 database server. See <xref linkend="mvcc"/> for more discussion
8956 <structname>pg_locks</structname> contains one row per active lockable
8957 object, requested lock mode, and relevant process. Thus, the same
8958 lockable object might
8959 appear many times, if multiple processes are holding or waiting
8960 for locks on it. However, an object that currently has no locks on it
8961 will not appear at all.
8965 There are several distinct types of lockable objects:
8966 whole relations (e.g., tables), individual pages of relations,
8967 individual tuples of relations,
8968 transaction IDs (both virtual and permanent IDs),
8969 and general database objects (identified by class OID and object OID,
8970 in the same way as in <structname>pg_description</structname> or
8971 <structname>pg_depend</structname>). Also, the right to extend a
8972 relation is represented as a separate lockable object.
8973 Also, <quote>advisory</quote> locks can be taken on numbers that have
8974 user-defined meanings.
8978 <title><structname>pg_locks</structname> Columns</title>
8985 <entry>References</entry>
8986 <entry>Description</entry>
8991 <entry><structfield>locktype</structfield></entry>
8992 <entry><type>text</type></entry>
8995 Type of the lockable object:
8996 <literal>relation</literal>,
8997 <literal>extend</literal>,
8998 <literal>page</literal>,
8999 <literal>tuple</literal>,
9000 <literal>transactionid</literal>,
9001 <literal>virtualxid</literal>,
9002 <literal>object</literal>,
9003 <literal>userlock</literal>, or
9004 <literal>advisory</literal>
9008 <entry><structfield>database</structfield></entry>
9009 <entry><type>oid</type></entry>
9010 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
9012 OID of the database in which the lock target exists, or
9013 zero if the target is a shared object, or
9014 null if the target is a transaction ID
9018 <entry><structfield>relation</structfield></entry>
9019 <entry><type>oid</type></entry>
9020 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
9022 OID of the relation targeted by the lock, or null if the target is not
9023 a relation or part of a relation
9027 <entry><structfield>page</structfield></entry>
9028 <entry><type>integer</type></entry>
9031 Page number targeted by the lock within the relation,
9032 or null if the target is not a relation page or tuple
9036 <entry><structfield>tuple</structfield></entry>
9037 <entry><type>smallint</type></entry>
9040 Tuple number targeted by the lock within the page,
9041 or null if the target is not a tuple
9045 <entry><structfield>virtualxid</structfield></entry>
9046 <entry><type>text</type></entry>
9049 Virtual ID of the transaction targeted by the lock,
9050 or null if the target is not a virtual transaction ID
9054 <entry><structfield>transactionid</structfield></entry>
9055 <entry><type>xid</type></entry>
9058 ID of the transaction targeted by the lock,
9059 or null if the target is not a transaction ID
9063 <entry><structfield>classid</structfield></entry>
9064 <entry><type>oid</type></entry>
9065 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
9067 OID of the system catalog containing the lock target, or null if the
9068 target is not a general database object
9072 <entry><structfield>objid</structfield></entry>
9073 <entry><type>oid</type></entry>
9074 <entry>any OID column</entry>
9076 OID of the lock target within its system catalog, or null if the
9077 target is not a general database object
9081 <entry><structfield>objsubid</structfield></entry>
9082 <entry><type>smallint</type></entry>
9085 Column number targeted by the lock (the
9086 <structfield>classid</structfield> and <structfield>objid</structfield> refer to the
9088 or zero if the target is some other general database object,
9089 or null if the target is not a general database object
9093 <entry><structfield>virtualtransaction</structfield></entry>
9094 <entry><type>text</type></entry>
9097 Virtual ID of the transaction that is holding or awaiting this lock
9101 <entry><structfield>pid</structfield></entry>
9102 <entry><type>integer</type></entry>
9105 Process ID of the server process holding or awaiting this
9106 lock, or null if the lock is held by a prepared transaction
9110 <entry><structfield>mode</structfield></entry>
9111 <entry><type>text</type></entry>
9113 <entry>Name of the lock mode held or desired by this process (see <xref
9114 linkend="locking-tables"/> and <xref linkend="xact-serializable"/>)</entry>
9117 <entry><structfield>granted</structfield></entry>
9118 <entry><type>boolean</type></entry>
9120 <entry>True if lock is held, false if lock is awaited</entry>
9123 <entry><structfield>fastpath</structfield></entry>
9124 <entry><type>boolean</type></entry>
9126 <entry>True if lock was taken via fast path, false if taken via main
9134 <structfield>granted</structfield> is true in a row representing a lock
9135 held by the indicated process. False indicates that this process is
9136 currently waiting to acquire this lock, which implies that at least one
9137 other process is holding or waiting for a conflicting lock mode on the same
9138 lockable object. The waiting process will sleep until the other lock is
9139 released (or a deadlock situation is detected). A single process can be
9140 waiting to acquire at most one lock at a time.
9144 Throughout running a transaction, a server process holds an exclusive lock
9145 on the transaction's virtual transaction ID. If a permanent ID is assigned
9146 to the transaction (which normally happens only if the transaction changes
9147 the state of the database), it also holds an exclusive lock on the
9148 transaction's permanent transaction ID until it ends. When a process finds
9149 it necessary to wait specifically for another transaction to end, it does
9150 so by attempting to acquire share lock on the other transaction's ID
9151 (either virtual or permanent ID depending on the situation). That will
9152 succeed only when the other transaction terminates and releases its locks.
9156 Although tuples are a lockable type of object,
9157 information about row-level locks is stored on disk, not in memory,
9158 and therefore row-level locks normally do not appear in this view.
9159 If a process is waiting for a
9160 row-level lock, it will usually appear in the view as waiting for the
9161 permanent transaction ID of the current holder of that row lock.
9165 Advisory locks can be acquired on keys consisting of either a single
9166 <type>bigint</type> value or two integer values.
9167 A <type>bigint</type> key is displayed with its
9168 high-order half in the <structfield>classid</structfield> column, its low-order half
9169 in the <structfield>objid</structfield> column, and <structfield>objsubid</structfield> equal
9170 to 1. The original <type>bigint</type> value can be reassembled with the
9171 expression <literal>(classid::bigint << 32) |
9172 objid::bigint</literal>. Integer keys are displayed with the
9174 <structfield>classid</structfield> column, the second key in the <structfield>objid</structfield>
9175 column, and <structfield>objsubid</structfield> equal to 2. The actual meaning of
9176 the keys is up to the user. Advisory locks are local to each database,
9177 so the <structfield>database</structfield> column is meaningful for an advisory lock.
9181 <structname>pg_locks</structname> provides a global view of all locks
9182 in the database cluster, not only those relevant to the current database.
9183 Although its <structfield>relation</structfield> column can be joined
9184 against <structname>pg_class</structname>.<structfield>oid</structfield> to identify locked
9185 relations, this will only work correctly for relations in the current
9186 database (those for which the <structfield>database</structfield> column
9187 is either the current database's OID or zero).
9191 The <structfield>pid</structfield> column can be joined to the
9192 <structfield>pid</structfield> column of the <link
9193 linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
9195 information on the session holding or awaiting each lock,
9198 SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa
9199 ON pl.pid = psa.pid;
9201 Also, if you are using prepared transactions, the
9202 <structfield>virtualtransaction</structfield> column can be joined to the
9203 <structfield>transaction</structfield> column of the <link
9204 linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link>
9205 view to get more information on prepared transactions that hold locks.
9206 (A prepared transaction can never be waiting for a lock,
9207 but it continues to hold the locks it acquired while running.)
9210 SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
9211 ON pl.virtualtransaction = '-1/' || ppx.transaction;
9216 While it is possible to obtain information about which processes block
9217 which other processes by joining <structname>pg_locks</structname> against
9218 itself, this is very difficult to get right in detail. Such a query would
9219 have to encode knowledge about which lock modes conflict with which
9220 others. Worse, the <structname>pg_locks</structname> view does not expose
9221 information about which processes are ahead of which others in lock wait
9222 queues, nor information about which processes are parallel workers running
9223 on behalf of which other client sessions. It is better to use
9224 the <function>pg_blocking_pids()</function> function
9225 (see <xref linkend="functions-info-session-table"/>) to identify which
9226 process(es) a waiting process is blocked behind.
9230 The <structname>pg_locks</structname> view displays data from both the
9231 regular lock manager and the predicate lock manager, which are
9232 separate systems; in addition, the regular lock manager subdivides its
9233 locks into regular and <firstterm>fast-path</firstterm> locks.
9234 This data is not guaranteed to be entirely consistent.
9235 When the view is queried,
9236 data on fast-path locks (with <structfield>fastpath</structfield> = <literal>true</literal>)
9237 is gathered from each backend one at a time, without freezing the state of
9238 the entire lock manager, so it is possible for locks to be taken or
9239 released while information is gathered. Note, however, that these locks are
9240 known not to conflict with any other lock currently in place. After
9241 all backends have been queried for fast-path locks, the remainder of the
9242 regular lock manager is locked as a unit, and a consistent snapshot of all
9243 remaining locks is collected as an atomic action. After unlocking the
9244 regular lock manager, the predicate lock manager is similarly locked and all
9245 predicate locks are collected as an atomic action. Thus, with the exception
9246 of fast-path locks, each lock manager will deliver a consistent set of
9247 results, but as we do not lock both lock managers simultaneously, it is
9248 possible for locks to be taken or released after we interrogate the regular
9249 lock manager and before we interrogate the predicate lock manager.
9253 Locking the regular and/or predicate lock manager could have some
9254 impact on database performance if this view is very frequently accessed.
9255 The locks are held only for the minimum amount of time necessary to
9256 obtain data from the lock managers, but this does not completely eliminate
9257 the possibility of a performance impact.
9262 <sect1 id="view-pg-matviews">
9263 <title><structname>pg_matviews</structname></title>
9265 <indexterm zone="view-pg-matviews">
9266 <primary>pg_matviews</primary>
9269 <indexterm zone="view-pg-matviews">
9270 <primary>materialized views</primary>
9274 The view <structname>pg_matviews</structname> provides access to
9275 useful information about each materialized view in the database.
9279 <title><structname>pg_matviews</structname> Columns</title>
9286 <entry>References</entry>
9287 <entry>Description</entry>
9292 <entry><structfield>schemaname</structfield></entry>
9293 <entry><type>name</type></entry>
9294 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
9295 <entry>Name of schema containing materialized view</entry>
9298 <entry><structfield>matviewname</structfield></entry>
9299 <entry><type>name</type></entry>
9300 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
9301 <entry>Name of materialized view</entry>
9304 <entry><structfield>matviewowner</structfield></entry>
9305 <entry><type>name</type></entry>
9306 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
9307 <entry>Name of materialized view's owner</entry>
9310 <entry><structfield>tablespace</structfield></entry>
9311 <entry><type>name</type></entry>
9312 <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
9313 <entry>Name of tablespace containing materialized view (null if default for database)</entry>
9316 <entry><structfield>hasindexes</structfield></entry>
9317 <entry><type>boolean</type></entry>
9319 <entry>True if materialized view has (or recently had) any indexes</entry>
9322 <entry><structfield>ispopulated</structfield></entry>
9323 <entry><type>boolean</type></entry>
9325 <entry>True if materialized view is currently populated</entry>
9328 <entry><structfield>definition</structfield></entry>
9329 <entry><type>text</type></entry>
9331 <entry>Materialized view definition (a reconstructed <command>SELECT</command> query)</entry>
9339 <sect1 id="view-pg-policies">
9340 <title><structname>pg_policies</structname></title>
9342 <indexterm zone="view-pg-policies">
9343 <primary>pg_policies</primary>
9347 The view <structname>pg_policies</structname> provides access to
9348 useful information about each row-level security policy in the database.
9352 <title><structname>pg_policies</structname> Columns</title>
9359 <entry>References</entry>
9360 <entry>Description</entry>
9365 <entry><structfield>schemaname</structfield></entry>
9366 <entry><type>name</type></entry>
9367 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
9368 <entry>Name of schema containing table policy is on</entry>
9371 <entry><structfield>tablename</structfield></entry>
9372 <entry><type>name</type></entry>
9373 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
9374 <entry>Name of table policy is on</entry>
9377 <entry><structfield>policyname</structfield></entry>
9378 <entry><type>name</type></entry>
9379 <entry><literal><link linkend="catalog-pg-policy"><structname>pg_policy</structname></link>.polname</literal></entry>
9380 <entry>Name of policy</entry>
9383 <entry><structfield>polpermissive</structfield></entry>
9384 <entry><type>text</type></entry>
9386 <entry>Is the policy permissive or restrictive?</entry>
9389 <entry><structfield>roles</structfield></entry>
9390 <entry><type>name[]</type></entry>
9392 <entry>The roles to which this policy applies</entry>
9395 <entry><structfield>cmd</structfield></entry>
9396 <entry><type>text</type></entry>
9398 <entry>The command type to which the policy is applied</entry>
9401 <entry><structfield>qual</structfield></entry>
9402 <entry><type>text</type></entry>
9404 <entry>The expression added to the security barrier qualifications for
9405 queries that this policy applies to</entry>
9408 <entry><structfield>with_check</structfield></entry>
9409 <entry><type>text</type></entry>
9411 <entry>The expression added to the WITH CHECK qualifications for
9412 queries that attempt to add rows to this table</entry>
9420 <sect1 id="view-pg-prepared-statements">
9421 <title><structname>pg_prepared_statements</structname></title>
9423 <indexterm zone="view-pg-prepared-statements">
9424 <primary>pg_prepared_statements</primary>
9428 The <structname>pg_prepared_statements</structname> view displays
9429 all the prepared statements that are available in the current
9430 session. See <xref linkend="sql-prepare"/> for more information about prepared
9435 <structname>pg_prepared_statements</structname> contains one row
9436 for each prepared statement. Rows are added to the view when a new
9437 prepared statement is created and removed when a prepared statement
9438 is released (for example, via the <xref linkend="sql-deallocate"/> command).
9442 <title><structname>pg_prepared_statements</structname> Columns</title>
9449 <entry>Description</entry>
9454 <entry><structfield>name</structfield></entry>
9455 <entry><type>text</type></entry>
9457 The identifier of the prepared statement
9461 <entry><structfield>statement</structfield></entry>
9462 <entry><type>text</type></entry>
9464 The query string submitted by the client to create this
9465 prepared statement. For prepared statements created via SQL,
9466 this is the <command>PREPARE</command> statement submitted by
9467 the client. For prepared statements created via the
9468 frontend/backend protocol, this is the text of the prepared
9473 <entry><structfield>prepare_time</structfield></entry>
9474 <entry><type>timestamptz</type></entry>
9476 The time at which the prepared statement was created
9480 <entry><structfield>parameter_types</structfield></entry>
9481 <entry><type>regtype[]</type></entry>
9483 The expected parameter types for the prepared statement in the
9484 form of an array of <type>regtype</type>. The OID corresponding
9485 to an element of this array can be obtained by casting the
9486 <type>regtype</type> value to <type>oid</type>.
9490 <entry><structfield>from_sql</structfield></entry>
9491 <entry><type>boolean</type></entry>
9493 <literal>true</literal> if the prepared statement was created
9494 via the <command>PREPARE</command> SQL command;
9495 <literal>false</literal> if the statement was prepared via the
9496 frontend/backend protocol
9504 The <structname>pg_prepared_statements</structname> view is read only.
9508 <sect1 id="view-pg-prepared-xacts">
9509 <title><structname>pg_prepared_xacts</structname></title>
9511 <indexterm zone="view-pg-prepared-xacts">
9512 <primary>pg_prepared_xacts</primary>
9516 The view <structname>pg_prepared_xacts</structname> displays
9517 information about transactions that are currently prepared for two-phase
9518 commit (see <xref linkend="sql-prepare-transaction"/> for details).
9522 <structname>pg_prepared_xacts</structname> contains one row per prepared
9523 transaction. An entry is removed when the transaction is committed or
9528 <title><structname>pg_prepared_xacts</structname> Columns</title>
9535 <entry>References</entry>
9536 <entry>Description</entry>
9541 <entry><structfield>transaction</structfield></entry>
9542 <entry><type>xid</type></entry>
9545 Numeric transaction identifier of the prepared transaction
9549 <entry><structfield>gid</structfield></entry>
9550 <entry><type>text</type></entry>
9553 Global transaction identifier that was assigned to the transaction
9557 <entry><structfield>prepared</structfield></entry>
9558 <entry><type>timestamp with time zone</type></entry>
9561 Time at which the transaction was prepared for commit
9565 <entry><structfield>owner</structfield></entry>
9566 <entry><type>name</type></entry>
9567 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
9569 Name of the user that executed the transaction
9573 <entry><structfield>database</structfield></entry>
9574 <entry><type>name</type></entry>
9575 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.datname</literal></entry>
9577 Name of the database in which the transaction was executed
9585 When the <structname>pg_prepared_xacts</structname> view is accessed, the
9586 internal transaction manager data structures are momentarily locked, and
9587 a copy is made for the view to display. This ensures that the
9588 view produces a consistent set of results, while not blocking
9589 normal operations longer than necessary. Nonetheless
9590 there could be some impact on database performance if this view is
9591 frequently accessed.
9596 <sect1 id="view-pg-publication-tables">
9597 <title><structname>pg_publication_tables</structname></title>
9599 <indexterm zone="view-pg-publication-tables">
9600 <primary>pg_publication_tables</primary>
9604 The view <structname>pg_publication_tables</structname> provides
9605 information about the mapping between publications and the tables they
9606 contain. Unlike the underlying
9607 catalog <structname>pg_publication_rel</structname>, this view expands
9608 publications defined as <literal>FOR ALL TABLES</literal>, so for such
9609 publications there will be a row for each eligible table.
9613 <title><structname>pg_publication_tables</structname> Columns</title>
9620 <entry>References</entry>
9621 <entry>Description</entry>
9627 <entry><structfield>pubname</structfield></entry>
9628 <entry><type>name</type></entry>
9629 <entry><literal><link linkend="catalog-pg-publication"><structname>pg_publication</structname></link>.pubname</literal></entry>
9630 <entry>Name of publication</entry>
9634 <entry><structfield>schemaname</structfield></entry>
9635 <entry><type>name</type></entry>
9636 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
9637 <entry>Name of schema containing table</entry>
9641 <entry><structfield>tablename</structfield></entry>
9642 <entry><type>name</type></entry>
9643 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
9644 <entry>Name of table</entry>
9651 <sect1 id="view-pg-replication-origin-status">
9652 <title><structname>pg_replication_origin_status</structname></title>
9654 <indexterm zone="view-pg-replication-origin-status">
9655 <primary>pg_replication_origin_status</primary>
9659 The <structname>pg_replication_origin_status</structname> view
9660 contains information about how far replay for a certain origin has
9661 progressed. For more on replication origins
9662 see <xref linkend="replication-origins"/>.
9667 <title><structname>pg_replication_origin_status</structname> Columns</title>
9674 <entry>References</entry>
9675 <entry>Description</entry>
9681 <entry><structfield>local_id</structfield></entry>
9682 <entry><type>Oid</type></entry>
9683 <entry><literal><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.roident</literal></entry>
9684 <entry>internal node identifier</entry>
9688 <entry><structfield>external_id</structfield></entry>
9689 <entry><type>text</type></entry>
9690 <entry><literal><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.roname</literal></entry>
9691 <entry>external node identifier</entry>
9695 <entry><structfield>remote_lsn</structfield></entry>
9696 <entry><type>pg_lsn</type></entry>
9698 <entry>The origin node's LSN up to which data has been replicated.</entry>
9702 <entry><structfield>local_lsn</structfield></entry>
9703 <entry><type>pg_lsn</type></entry>
9706 This node's LSN at which <literal>remote_lsn</literal> has
9707 been replicated. Used to flush commit records before persisting
9708 data to disk when using asynchronous commits.
9716 <sect1 id="view-pg-replication-slots">
9717 <title><structname>pg_replication_slots</structname></title>
9719 <indexterm zone="view-pg-replication-slots">
9720 <primary>pg_replication_slots</primary>
9724 The <structname>pg_replication_slots</structname> view provides a listing
9725 of all replication slots that currently exist on the database cluster,
9726 along with their current state.
9730 For more on replication slots,
9731 see <xref linkend="streaming-replication-slots"/> and <xref linkend="logicaldecoding"/>.
9736 <title><structname>pg_replication_slots</structname> Columns</title>
9743 <entry>References</entry>
9744 <entry>Description</entry>
9750 <entry><structfield>slot_name</structfield></entry>
9751 <entry><type>name</type></entry>
9753 <entry>A unique, cluster-wide identifier for the replication slot</entry>
9757 <entry><structfield>plugin</structfield></entry>
9758 <entry><type>name</type></entry>
9760 <entry>The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.</entry>
9764 <entry><structfield>slot_type</structfield></entry>
9765 <entry><type>text</type></entry>
9767 <entry>The slot type - <literal>physical</literal> or <literal>logical</literal></entry>
9771 <entry><structfield>datoid</structfield></entry>
9772 <entry><type>oid</type></entry>
9773 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
9774 <entry>The OID of the database this slot is associated with, or
9775 null. Only logical slots have an associated database.</entry>
9779 <entry><structfield>database</structfield></entry>
9780 <entry><type>text</type></entry>
9781 <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.datname</literal></entry>
9782 <entry>The name of the database this slot is associated with, or
9783 null. Only logical slots have an associated database.</entry>
9787 <entry><structfield>temporary</structfield></entry>
9788 <entry><type>boolean</type></entry>
9790 <entry>True if this is a temporary replication slot. Temporary slots are
9791 not saved to disk and are automatically dropped on error or when
9792 the session has finished.</entry>
9796 <entry><structfield>active</structfield></entry>
9797 <entry><type>boolean</type></entry>
9799 <entry>True if this slot is currently actively being used</entry>
9803 <entry><structfield>active_pid</structfield></entry>
9804 <entry><type>integer</type></entry>
9806 <entry>The process ID of the session using this slot if the slot
9807 is currently actively being used. <literal>NULL</literal> if
9813 <entry><structfield>xmin</structfield></entry>
9814 <entry><type>xid</type></entry>
9816 <entry>The oldest transaction that this slot needs the database to
9817 retain. <literal>VACUUM</literal> cannot remove tuples deleted
9818 by any later transaction.
9823 <entry><structfield>catalog_xmin</structfield></entry>
9824 <entry><type>xid</type></entry>
9826 <entry>The oldest transaction affecting the system catalogs that this
9827 slot needs the database to retain. <literal>VACUUM</literal> cannot
9828 remove catalog tuples deleted by any later transaction.
9833 <entry><structfield>restart_lsn</structfield></entry>
9834 <entry><type>pg_lsn</type></entry>
9836 <entry>The address (<literal>LSN</literal>) of oldest WAL which still
9837 might be required by the consumer of this slot and thus won't be
9838 automatically removed during checkpoints.
9843 <entry><structfield>confirmed_flush_lsn</structfield></entry>
9844 <entry><type>pg_lsn</type></entry>
9846 <entry>The address (<literal>LSN</literal>) up to which the logical
9847 slot's consumer has confirmed receiving data. Data older than this is
9848 not available anymore. <literal>NULL</literal> for physical slots.
9857 <sect1 id="view-pg-roles">
9858 <title><structname>pg_roles</structname></title>
9860 <indexterm zone="view-pg-roles">
9861 <primary>pg_roles</primary>
9865 The view <structname>pg_roles</structname> provides access to
9866 information about database roles. This is simply a publicly
9868 <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
9869 that blanks out the password field.
9873 This view explicitly exposes the OID column of the underlying table,
9874 since that is needed to do joins to other catalogs.
9878 <title><structname>pg_roles</structname> Columns</title>
9885 <entry>References</entry>
9886 <entry>Description</entry>
9892 <entry><structfield>rolname</structfield></entry>
9893 <entry><type>name</type></entry>
9895 <entry>Role name</entry>
9899 <entry><structfield>rolsuper</structfield></entry>
9900 <entry><type>bool</type></entry>
9902 <entry>Role has superuser privileges</entry>
9906 <entry><structfield>rolinherit</structfield></entry>
9907 <entry><type>bool</type></entry>
9909 <entry>Role automatically inherits privileges of roles it is a
9914 <entry><structfield>rolcreaterole</structfield></entry>
9915 <entry><type>bool</type></entry>
9917 <entry>Role can create more roles</entry>
9921 <entry><structfield>rolcreatedb</structfield></entry>
9922 <entry><type>bool</type></entry>
9924 <entry>Role can create databases</entry>
9928 <entry><structfield>rolcanlogin</structfield></entry>
9929 <entry><type>bool</type></entry>
9932 Role can log in. That is, this role can be given as the initial
9933 session authorization identifier
9938 <entry><structfield>rolreplication</structfield></entry>
9939 <entry><type>bool</type></entry>
9942 Role is a replication role. A replication role can initiate replication
9943 connections and create and drop replication slots.
9948 <entry><structfield>rolconnlimit</structfield></entry>
9949 <entry><type>int4</type></entry>
9952 For roles that can log in, this sets maximum number of concurrent
9953 connections this role can make. -1 means no limit.
9958 <entry><structfield>rolpassword</structfield></entry>
9959 <entry><type>text</type></entry>
9961 <entry>Not the password (always reads as <literal>********</literal>)</entry>
9965 <entry><structfield>rolvaliduntil</structfield></entry>
9966 <entry><type>timestamptz</type></entry>
9968 <entry>Password expiry time (only used for password authentication);
9969 null if no expiration</entry>
9973 <entry><structfield>rolbypassrls</structfield></entry>
9974 <entry><type>bool</type></entry>
9977 Role bypasses every row level security policy, see
9978 <xref linkend="ddl-rowsecurity"/> for more information.
9983 <entry><structfield>rolconfig</structfield></entry>
9984 <entry><type>text[]</type></entry>
9986 <entry>Role-specific defaults for run-time configuration variables</entry>
9990 <entry><structfield>oid</structfield></entry>
9991 <entry><type>oid</type></entry>
9992 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
9993 <entry>ID of role</entry>
10001 <sect1 id="view-pg-rules">
10002 <title><structname>pg_rules</structname></title>
10004 <indexterm zone="view-pg-rules">
10005 <primary>pg_rules</primary>
10009 The view <structname>pg_rules</structname> provides access to
10010 useful information about query rewrite rules.
10014 <title><structname>pg_rules</structname> Columns</title>
10019 <entry>Name</entry>
10020 <entry>Type</entry>
10021 <entry>References</entry>
10022 <entry>Description</entry>
10027 <entry><structfield>schemaname</structfield></entry>
10028 <entry><type>name</type></entry>
10029 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
10030 <entry>Name of schema containing table</entry>
10033 <entry><structfield>tablename</structfield></entry>
10034 <entry><type>name</type></entry>
10035 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
10036 <entry>Name of table the rule is for</entry>
10039 <entry><structfield>rulename</structfield></entry>
10040 <entry><type>name</type></entry>
10041 <entry><literal><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link>.rulename</literal></entry>
10042 <entry>Name of rule</entry>
10045 <entry><structfield>definition</structfield></entry>
10046 <entry><type>text</type></entry>
10048 <entry>Rule definition (a reconstructed creation command)</entry>
10055 The <structname>pg_rules</structname> view excludes the <literal>ON SELECT</literal> rules
10056 of views and materialized views; those can be seen in
10057 <structname>pg_views</structname> and <structname>pg_matviews</structname>.
10062 <sect1 id="view-pg-seclabels">
10063 <title><structname>pg_seclabels</structname></title>
10065 <indexterm zone="view-pg-seclabels">
10066 <primary>pg_seclabels</primary>
10070 The view <structname>pg_seclabels</structname> provides information about
10071 security labels. It as an easier-to-query version of the
10072 <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link> catalog.
10076 <title><structname>pg_seclabels</structname> Columns</title>
10081 <entry>Name</entry>
10082 <entry>Type</entry>
10083 <entry>References</entry>
10084 <entry>Description</entry>
10089 <entry><structfield>objoid</structfield></entry>
10090 <entry><type>oid</type></entry>
10091 <entry>any OID column</entry>
10092 <entry>The OID of the object this security label pertains to</entry>
10095 <entry><structfield>classoid</structfield></entry>
10096 <entry><type>oid</type></entry>
10097 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
10098 <entry>The OID of the system catalog this object appears in</entry>
10101 <entry><structfield>objsubid</structfield></entry>
10102 <entry><type>int4</type></entry>
10105 For a security label on a table column, this is the column number (the
10106 <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to
10107 the table itself). For all other object types, this column is
10112 <entry><structfield>objtype</structfield></entry>
10113 <entry><type>text</type></entry>
10116 The type of object to which this label applies, as text.
10120 <entry><structfield>objnamespace</structfield></entry>
10121 <entry><type>oid</type></entry>
10122 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
10124 The OID of the namespace for this object, if applicable;
10129 <entry><structfield>objname</structfield></entry>
10130 <entry><type>text</type></entry>
10133 The name of the object to which this label applies, as text.
10137 <entry><structfield>provider</structfield></entry>
10138 <entry><type>text</type></entry>
10139 <entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.provider</literal></entry>
10140 <entry>The label provider associated with this label.</entry>
10143 <entry><structfield>label</structfield></entry>
10144 <entry><type>text</type></entry>
10145 <entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.label</literal></entry>
10146 <entry>The security label applied to this object.</entry>
10153 <sect1 id="view-pg-sequences">
10154 <title><structname>pg_sequences</structname></title>
10156 <indexterm zone="view-pg-sequences">
10157 <primary>pg_sequences</primary>
10161 The view <structname>pg_sequences</structname> provides access to
10162 useful information about each sequence in the database.
10166 <title><structname>pg_sequences</structname> Columns</title>
10171 <entry>Name</entry>
10172 <entry>Type</entry>
10173 <entry>References</entry>
10174 <entry>Description</entry>
10179 <entry><structfield>schemaname</structfield></entry>
10180 <entry><type>name</type></entry>
10181 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
10182 <entry>Name of schema containing sequence</entry>
10185 <entry><structfield>sequencename</structfield></entry>
10186 <entry><type>name</type></entry>
10187 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
10188 <entry>Name of sequence</entry>
10191 <entry><structfield>sequenceowner</structfield></entry>
10192 <entry><type>name</type></entry>
10193 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
10194 <entry>Name of sequence's owner</entry>
10197 <entry><structfield>data_type</structfield></entry>
10198 <entry><type>regtype</type></entry>
10199 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_type</structname></link>.oid</literal></entry>
10200 <entry>Data type of the sequence</entry>
10203 <entry><structfield>start_value</structfield></entry>
10204 <entry><type>bigint</type></entry>
10206 <entry>Start value of the sequence</entry>
10209 <entry><structfield>min_value</structfield></entry>
10210 <entry><type>bigint</type></entry>
10212 <entry>Minimum value of the sequence</entry>
10215 <entry><structfield>max_value</structfield></entry>
10216 <entry><type>bigint</type></entry>
10218 <entry>Maximum value of the sequence</entry>
10221 <entry><structfield>increment_by</structfield></entry>
10222 <entry><type>bigint</type></entry>
10224 <entry>Increment value of the sequence</entry>
10227 <entry><structfield>cycle</structfield></entry>
10228 <entry><type>boolean</type></entry>
10230 <entry>Whether the sequence cycles</entry>
10233 <entry><structfield>cache_size</structfield></entry>
10234 <entry><type>bigint</type></entry>
10236 <entry>Cache size of the sequence</entry>
10239 <entry><structfield>last_value</structfield></entry>
10240 <entry><type>bigint</type></entry>
10242 <entry>The last sequence value written to disk. If caching is used,
10243 this value can be greater than the last value handed out from the
10244 sequence. Null if the sequence has not been read from yet. Also, if
10245 the current user does not have <literal>USAGE</literal>
10246 or <literal>SELECT</literal> privilege on the sequence, the value is
10254 <sect1 id="view-pg-settings">
10255 <title><structname>pg_settings</structname></title>
10257 <indexterm zone="view-pg-settings">
10258 <primary>pg_settings</primary>
10262 The view <structname>pg_settings</structname> provides access to
10263 run-time parameters of the server. It is essentially an alternative
10264 interface to the <xref linkend="sql-show"/>
10265 and <xref linkend="sql-set"/> commands.
10266 It also provides access to some facts about each parameter that are
10267 not directly available from <command>SHOW</command>, such as minimum and
10272 <title><structname>pg_settings</structname> Columns</title>
10277 <entry>Name</entry>
10278 <entry>Type</entry>
10279 <entry>Description</entry>
10284 <entry><structfield>name</structfield></entry>
10285 <entry><type>text</type></entry>
10286 <entry>Run-time configuration parameter name</entry>
10289 <entry><structfield>setting</structfield></entry>
10290 <entry><type>text</type></entry>
10291 <entry>Current value of the parameter</entry>
10294 <entry><structfield>unit</structfield></entry>
10295 <entry><type>text</type></entry>
10296 <entry>Implicit unit of the parameter</entry>
10299 <entry><structfield>category</structfield></entry>
10300 <entry><type>text</type></entry>
10301 <entry>Logical group of the parameter</entry>
10304 <entry><structfield>short_desc</structfield></entry>
10305 <entry><type>text</type></entry>
10306 <entry>A brief description of the parameter</entry>
10309 <entry><structfield>extra_desc</structfield></entry>
10310 <entry><type>text</type></entry>
10311 <entry>Additional, more detailed, description of the parameter</entry>
10314 <entry><structfield>context</structfield></entry>
10315 <entry><type>text</type></entry>
10316 <entry>Context required to set the parameter's value (see below)</entry>
10319 <entry><structfield>vartype</structfield></entry>
10320 <entry><type>text</type></entry>
10321 <entry>Parameter type (<literal>bool</literal>, <literal>enum</literal>,
10322 <literal>integer</literal>, <literal>real</literal>, or <literal>string</literal>)
10326 <entry><structfield>source</structfield></entry>
10327 <entry><type>text</type></entry>
10328 <entry>Source of the current parameter value</entry>
10331 <entry><structfield>min_val</structfield></entry>
10332 <entry><type>text</type></entry>
10333 <entry>Minimum allowed value of the parameter (null for non-numeric
10337 <entry><structfield>max_val</structfield></entry>
10338 <entry><type>text</type></entry>
10339 <entry>Maximum allowed value of the parameter (null for non-numeric
10343 <entry><structfield>enumvals</structfield></entry>
10344 <entry><type>text[]</type></entry>
10345 <entry>Allowed values of an enum parameter (null for non-enum
10349 <entry><structfield>boot_val</structfield></entry>
10350 <entry><type>text</type></entry>
10351 <entry>Parameter value assumed at server startup if the parameter is
10352 not otherwise set</entry>
10355 <entry><structfield>reset_val</structfield></entry>
10356 <entry><type>text</type></entry>
10357 <entry>Value that <command>RESET</command> would reset the parameter to
10358 in the current session</entry>
10361 <entry><structfield>sourcefile</structfield></entry>
10362 <entry><type>text</type></entry>
10363 <entry>Configuration file the current value was set in (null for
10364 values set from sources other than configuration files, or when
10365 examined by a user who is neither a superuser or a member of
10366 <literal>pg_read_all_settings</literal>); helpful when using
10367 <literal>include</literal> directives in configuration files</entry>
10370 <entry><structfield>sourceline</structfield></entry>
10371 <entry><type>integer</type></entry>
10372 <entry>Line number within the configuration file the current value was
10373 set at (null for values set from sources other than configuration files,
10374 or when examined by a user who is neither a superuser or a member of
10375 <literal>pg_read_all_settings</literal>).
10379 <entry><structfield>pending_restart</structfield></entry>
10380 <entry><type>boolean</type></entry>
10381 <entry><literal>true</literal> if the value has been changed in the
10382 configuration file but needs a restart; or <literal>false</literal>
10391 There are several possible values of <structfield>context</structfield>.
10392 In order of decreasing difficulty of changing the setting, they are:
10397 <!-- PGC_INTERNAL -->
10398 <term><literal>internal</literal></term>
10401 These settings cannot be changed directly; they reflect internally
10402 determined values. Some of them may be adjustable by rebuilding the
10403 server with different configuration options, or by changing options
10404 supplied to <command>initdb</command>.
10409 <!-- PGC_POSTMASTER -->
10410 <term><literal>postmaster</literal></term>
10413 These settings can only be applied when the server starts, so any change
10414 requires restarting the server. Values for these settings are typically
10415 stored in the <filename>postgresql.conf</filename> file, or passed on
10416 the command line when starting the server. Of course, settings with any
10417 of the lower <structfield>context</structfield> types can also be
10418 set at server start time.
10423 <!-- PGC_SIGHUP -->
10424 <term><literal>sighup</literal></term>
10427 Changes to these settings can be made in
10428 <filename>postgresql.conf</filename> without restarting the server.
10429 Send a <systemitem>SIGHUP</systemitem> signal to the postmaster to
10430 cause it to re-read <filename>postgresql.conf</filename> and apply
10431 the changes. The postmaster will also forward the
10432 <systemitem>SIGHUP</systemitem> signal to its child processes so that
10433 they all pick up the new value.
10438 <!-- PGC_SU_BACKEND -->
10439 <term><literal>superuser-backend</literal></term>
10442 Changes to these settings can be made in
10443 <filename>postgresql.conf</filename> without restarting the server.
10444 They can also be set for a particular session in the connection request
10445 packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal>
10446 environment variable), but only if the connecting user is a superuser.
10447 However, these settings never change in a session after it is started.
10448 If you change them in <filename>postgresql.conf</filename>, send a
10449 <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
10450 re-read <filename>postgresql.conf</filename>. The new values will only
10451 affect subsequently-launched sessions.
10456 <!-- PGC_BACKEND -->
10457 <term><literal>backend</literal></term>
10460 Changes to these settings can be made in
10461 <filename>postgresql.conf</filename> without restarting the server.
10462 They can also be set for a particular session in the connection request
10463 packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal>
10464 environment variable); any user can make such a change for their session.
10465 However, these settings never change in a session after it is started.
10466 If you change them in <filename>postgresql.conf</filename>, send a
10467 <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
10468 re-read <filename>postgresql.conf</filename>. The new values will only
10469 affect subsequently-launched sessions.
10475 <term><literal>superuser</literal></term>
10478 These settings can be set from <filename>postgresql.conf</filename>,
10479 or within a session via the <command>SET</command> command; but only superusers
10480 can change them via <command>SET</command>. Changes in
10481 <filename>postgresql.conf</filename> will affect existing sessions
10482 only if no session-local value has been established with <command>SET</command>.
10487 <!-- PGC_USERSET -->
10488 <term><literal>user</literal></term>
10491 These settings can be set from <filename>postgresql.conf</filename>,
10492 or within a session via the <command>SET</command> command. Any user is
10493 allowed to change their session-local value. Changes in
10494 <filename>postgresql.conf</filename> will affect existing sessions
10495 only if no session-local value has been established with <command>SET</command>.
10502 See <xref linkend="config-setting"/> for more information about the various
10503 ways to change these parameters.
10507 The <structname>pg_settings</structname> view cannot be inserted into or
10508 deleted from, but it can be updated. An <command>UPDATE</command> applied
10509 to a row of <structname>pg_settings</structname> is equivalent to executing
10510 the <xref linkend="sql-set"/> command on that named
10511 parameter. The change only affects the value used by the current
10512 session. If an <command>UPDATE</command> is issued within a transaction
10513 that is later aborted, the effects of the <command>UPDATE</command> command
10514 disappear when the transaction is rolled back. Once the surrounding
10515 transaction is committed, the effects will persist until the end of the
10516 session, unless overridden by another <command>UPDATE</command> or
10517 <command>SET</command>.
10522 <sect1 id="view-pg-shadow">
10523 <title><structname>pg_shadow</structname></title>
10525 <indexterm zone="view-pg-shadow">
10526 <primary>pg_shadow</primary>
10530 The view <structname>pg_shadow</structname> exists for backwards
10531 compatibility: it emulates a catalog that existed in
10532 <productname>PostgreSQL</productname> before version 8.1.
10533 It shows properties of all roles that are marked as
10534 <structfield>rolcanlogin</structfield> in
10535 <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.
10539 The name stems from the fact that this table
10540 should not be readable by the public since it contains passwords.
10541 <link linkend="view-pg-user"><structname>pg_user</structname></link>
10542 is a publicly readable view on
10543 <structname>pg_shadow</structname> that blanks out the password field.
10547 <title><structname>pg_shadow</structname> Columns</title>
10552 <entry>Name</entry>
10553 <entry>Type</entry>
10554 <entry>References</entry>
10555 <entry>Description</entry>
10561 <entry><structfield>usename</structfield></entry>
10562 <entry><type>name</type></entry>
10563 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
10564 <entry>User name</entry>
10568 <entry><structfield>usesysid</structfield></entry>
10569 <entry><type>oid</type></entry>
10570 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
10571 <entry>ID of this user</entry>
10575 <entry><structfield>usecreatedb</structfield></entry>
10576 <entry><type>bool</type></entry>
10578 <entry>User can create databases</entry>
10582 <entry><structfield>usesuper</structfield></entry>
10583 <entry><type>bool</type></entry>
10585 <entry>User is a superuser</entry>
10589 <entry><structfield>userepl</structfield></entry>
10590 <entry><type>bool</type></entry>
10593 User can initiate streaming replication and put the system in and
10594 out of backup mode.
10599 <entry><structfield>usebypassrls</structfield></entry>
10600 <entry><type>bool</type></entry>
10603 User bypasses every row level security policy, see
10604 <xref linkend="ddl-rowsecurity"/> for more information.
10609 <entry><structfield>passwd</structfield></entry>
10610 <entry><type>text</type></entry>
10612 <entry>Password (possibly encrypted); null if none. See
10613 <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
10614 for details of how encrypted passwords are stored.</entry>
10618 <entry><structfield>valuntil</structfield></entry>
10619 <entry><type>abstime</type></entry>
10621 <entry>Password expiry time (only used for password authentication)</entry>
10625 <entry><structfield>useconfig</structfield></entry>
10626 <entry><type>text[]</type></entry>
10628 <entry>Session defaults for run-time configuration variables</entry>
10636 <sect1 id="view-pg-stats">
10637 <title><structname>pg_stats</structname></title>
10639 <indexterm zone="view-pg-stats">
10640 <primary>pg_stats</primary>
10644 The view <structname>pg_stats</structname> provides access to
10645 the information stored in the <link
10646 linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>
10647 catalog. This view allows access only to rows of
10648 <structname>pg_statistic</structname> that correspond to tables the
10649 user has permission to read, and therefore it is safe to allow public
10650 read access to this view.
10654 <structname>pg_stats</structname> is also designed to present the
10655 information in a more readable format than the underlying catalog
10656 — at the cost that its schema must be extended whenever new slot types
10657 are defined for <structname>pg_statistic</structname>.
10661 <title><structname>pg_stats</structname> Columns</title>
10666 <entry>Name</entry>
10667 <entry>Type</entry>
10668 <entry>References</entry>
10669 <entry>Description</entry>
10674 <entry><structfield>schemaname</structfield></entry>
10675 <entry><type>name</type></entry>
10676 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
10677 <entry>Name of schema containing table</entry>
10681 <entry><structfield>tablename</structfield></entry>
10682 <entry><type>name</type></entry>
10683 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
10684 <entry>Name of table</entry>
10688 <entry><structfield>attname</structfield></entry>
10689 <entry><type>name</type></entry>
10690 <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attname</literal></entry>
10691 <entry>Name of the column described by this row</entry>
10695 <entry><structfield>inherited</structfield></entry>
10696 <entry><type>bool</type></entry>
10698 <entry>If true, this row includes inheritance child columns, not just the
10699 values in the specified table</entry>
10703 <entry><structfield>null_frac</structfield></entry>
10704 <entry><type>real</type></entry>
10706 <entry>Fraction of column entries that are null</entry>
10710 <entry><structfield>avg_width</structfield></entry>
10711 <entry><type>integer</type></entry>
10713 <entry>Average width in bytes of column's entries</entry>
10717 <entry><structfield>n_distinct</structfield></entry>
10718 <entry><type>real</type></entry>
10721 If greater than zero, the estimated number of distinct values in the
10722 column. If less than zero, the negative of the number of distinct
10723 values divided by the number of rows. (The negated form is used when
10724 <command>ANALYZE</command> believes that the number of distinct values is
10725 likely to increase as the table grows; the positive form is used when
10726 the column seems to have a fixed number of possible values.) For
10727 example, -1 indicates a unique column in which the number of distinct
10728 values is the same as the number of rows.
10733 <entry><structfield>most_common_vals</structfield></entry>
10734 <entry><type>anyarray</type></entry>
10737 A list of the most common values in the column. (Null if
10738 no values seem to be more common than any others.)
10743 <entry><structfield>most_common_freqs</structfield></entry>
10744 <entry><type>real[]</type></entry>
10747 A list of the frequencies of the most common values,
10748 i.e., number of occurrences of each divided by total number of rows.
10749 (Null when <structfield>most_common_vals</structfield> is.)
10754 <entry><structfield>histogram_bounds</structfield></entry>
10755 <entry><type>anyarray</type></entry>
10758 A list of values that divide the column's values into groups of
10759 approximately equal population. The values in
10760 <structfield>most_common_vals</structfield>, if present, are omitted from this
10761 histogram calculation. (This column is null if the column data type
10762 does not have a <literal><</literal> operator or if the
10763 <structfield>most_common_vals</structfield> list accounts for the entire
10769 <entry><structfield>correlation</structfield></entry>
10770 <entry><type>real</type></entry>
10773 Statistical correlation between physical row ordering and
10774 logical ordering of the column values. This ranges from -1 to +1.
10775 When the value is near -1 or +1, an index scan on the column will
10776 be estimated to be cheaper than when it is near zero, due to reduction
10777 of random access to the disk. (This column is null if the column data
10778 type does not have a <literal><</literal> operator.)
10783 <entry><structfield>most_common_elems</structfield></entry>
10784 <entry><type>anyarray</type></entry>
10787 A list of non-null element values most often appearing within values of
10788 the column. (Null for scalar types.)
10793 <entry><structfield>most_common_elem_freqs</structfield></entry>
10794 <entry><type>real[]</type></entry>
10797 A list of the frequencies of the most common element values, i.e., the
10798 fraction of rows containing at least one instance of the given value.
10799 Two or three additional values follow the per-element frequencies;
10800 these are the minimum and maximum of the preceding per-element
10801 frequencies, and optionally the frequency of null elements.
10802 (Null when <structfield>most_common_elems</structfield> is.)
10807 <entry><structfield>elem_count_histogram</structfield></entry>
10808 <entry><type>real[]</type></entry>
10811 A histogram of the counts of distinct non-null element values within the
10812 values of the column, followed by the average number of distinct
10813 non-null elements. (Null for scalar types.)
10821 The maximum number of entries in the array fields can be controlled on a
10822 column-by-column basis using the <command>ALTER TABLE SET STATISTICS</command>
10823 command, or globally by setting the
10824 <xref linkend="guc-default-statistics-target"/> run-time parameter.
10829 <sect1 id="view-pg-tables">
10830 <title><structname>pg_tables</structname></title>
10832 <indexterm zone="view-pg-tables">
10833 <primary>pg_tables</primary>
10837 The view <structname>pg_tables</structname> provides access to
10838 useful information about each table in the database.
10842 <title><structname>pg_tables</structname> Columns</title>
10847 <entry>Name</entry>
10848 <entry>Type</entry>
10849 <entry>References</entry>
10850 <entry>Description</entry>
10855 <entry><structfield>schemaname</structfield></entry>
10856 <entry><type>name</type></entry>
10857 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
10858 <entry>Name of schema containing table</entry>
10861 <entry><structfield>tablename</structfield></entry>
10862 <entry><type>name</type></entry>
10863 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
10864 <entry>Name of table</entry>
10867 <entry><structfield>tableowner</structfield></entry>
10868 <entry><type>name</type></entry>
10869 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
10870 <entry>Name of table's owner</entry>
10873 <entry><structfield>tablespace</structfield></entry>
10874 <entry><type>name</type></entry>
10875 <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
10876 <entry>Name of tablespace containing table (null if default for database)</entry>
10879 <entry><structfield>hasindexes</structfield></entry>
10880 <entry><type>boolean</type></entry>
10881 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasindex</literal></entry>
10882 <entry>True if table has (or recently had) any indexes</entry>
10885 <entry><structfield>hasrules</structfield></entry>
10886 <entry><type>boolean</type></entry>
10887 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasrules</literal></entry>
10888 <entry>True if table has (or once had) rules</entry>
10891 <entry><structfield>hastriggers</structfield></entry>
10892 <entry><type>boolean</type></entry>
10893 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhastriggers</literal></entry>
10894 <entry>True if table has (or once had) triggers</entry>
10897 <entry><structfield>rowsecurity</structfield></entry>
10898 <entry><type>boolean</type></entry>
10899 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relrowsecurity</literal></entry>
10900 <entry>True if row security is enabled on the table</entry>
10908 <sect1 id="view-pg-timezone-abbrevs">
10909 <title><structname>pg_timezone_abbrevs</structname></title>
10911 <indexterm zone="view-pg-timezone-abbrevs">
10912 <primary>pg_timezone_abbrevs</primary>
10916 The view <structname>pg_timezone_abbrevs</structname> provides a list
10917 of time zone abbreviations that are currently recognized by the datetime
10918 input routines. The contents of this view change when the
10919 <xref linkend="guc-timezone-abbreviations"/> run-time parameter is modified.
10923 <title><structname>pg_timezone_abbrevs</structname> Columns</title>
10928 <entry>Name</entry>
10929 <entry>Type</entry>
10930 <entry>Description</entry>
10935 <entry><structfield>abbrev</structfield></entry>
10936 <entry><type>text</type></entry>
10937 <entry>Time zone abbreviation</entry>
10940 <entry><structfield>utc_offset</structfield></entry>
10941 <entry><type>interval</type></entry>
10942 <entry>Offset from UTC (positive means east of Greenwich)</entry>
10945 <entry><structfield>is_dst</structfield></entry>
10946 <entry><type>boolean</type></entry>
10947 <entry>True if this is a daylight-savings abbreviation</entry>
10954 While most timezone abbreviations represent fixed offsets from UTC,
10955 there are some that have historically varied in value
10956 (see <xref linkend="datetime-config-files"/> for more information).
10957 In such cases this view presents their current meaning.
10962 <sect1 id="view-pg-timezone-names">
10963 <title><structname>pg_timezone_names</structname></title>
10965 <indexterm zone="view-pg-timezone-names">
10966 <primary>pg_timezone_names</primary>
10970 The view <structname>pg_timezone_names</structname> provides a list
10971 of time zone names that are recognized by <command>SET TIMEZONE</command>,
10972 along with their associated abbreviations, UTC offsets,
10973 and daylight-savings status. (Technically,
10974 <productname>PostgreSQL</productname> does not use UTC because leap
10975 seconds are not handled.)
10976 Unlike the abbreviations shown in <link
10977 linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link>, many of these names imply a set of daylight-savings transition
10978 date rules. Therefore, the associated information changes across local DST
10979 boundaries. The displayed information is computed based on the current
10980 value of <function>CURRENT_TIMESTAMP</function>.
10984 <title><structname>pg_timezone_names</structname> Columns</title>
10989 <entry>Name</entry>
10990 <entry>Type</entry>
10991 <entry>Description</entry>
10996 <entry><structfield>name</structfield></entry>
10997 <entry><type>text</type></entry>
10998 <entry>Time zone name</entry>
11001 <entry><structfield>abbrev</structfield></entry>
11002 <entry><type>text</type></entry>
11003 <entry>Time zone abbreviation</entry>
11006 <entry><structfield>utc_offset</structfield></entry>
11007 <entry><type>interval</type></entry>
11008 <entry>Offset from UTC (positive means east of Greenwich)</entry>
11011 <entry><structfield>is_dst</structfield></entry>
11012 <entry><type>boolean</type></entry>
11013 <entry>True if currently observing daylight savings</entry>
11021 <sect1 id="view-pg-user">
11022 <title><structname>pg_user</structname></title>
11024 <indexterm zone="view-pg-user">
11025 <primary>pg_user</primary>
11029 The view <structname>pg_user</structname> provides access to
11030 information about database users. This is simply a publicly
11032 <link linkend="view-pg-shadow"><structname>pg_shadow</structname></link>
11033 that blanks out the password field.
11037 <title><structname>pg_user</structname> Columns</title>
11042 <entry>Name</entry>
11043 <entry>Type</entry>
11044 <entry>Description</entry>
11049 <entry><structfield>usename</structfield></entry>
11050 <entry><type>name</type></entry>
11051 <entry>User name</entry>
11055 <entry><structfield>usesysid</structfield></entry>
11056 <entry><type>oid</type></entry>
11057 <entry>ID of this user</entry>
11061 <entry><structfield>usecreatedb</structfield></entry>
11062 <entry><type>bool</type></entry>
11063 <entry>User can create databases</entry>
11067 <entry><structfield>usesuper</structfield></entry>
11068 <entry><type>bool</type></entry>
11069 <entry>User is a superuser</entry>
11073 <entry><structfield>userepl</structfield></entry>
11074 <entry><type>bool</type></entry>
11076 User can initiate streaming replication and put the system in and
11077 out of backup mode.
11082 <entry><structfield>usebypassrls</structfield></entry>
11083 <entry><type>bool</type></entry>
11085 User bypasses every row level security policy, see
11086 <xref linkend="ddl-rowsecurity"/> for more information.
11091 <entry><structfield>passwd</structfield></entry>
11092 <entry><type>text</type></entry>
11093 <entry>Not the password (always reads as <literal>********</literal>)</entry>
11097 <entry><structfield>valuntil</structfield></entry>
11098 <entry><type>abstime</type></entry>
11099 <entry>Password expiry time (only used for password authentication)</entry>
11103 <entry><structfield>useconfig</structfield></entry>
11104 <entry><type>text[]</type></entry>
11105 <entry>Session defaults for run-time configuration variables</entry>
11113 <sect1 id="view-pg-user-mappings">
11114 <title><structname>pg_user_mappings</structname></title>
11116 <indexterm zone="view-pg-user-mappings">
11117 <primary>pg_user_mappings</primary>
11121 The view <structname>pg_user_mappings</structname> provides access
11122 to information about user mappings. This is essentially a publicly
11124 <link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>
11125 that leaves out the options field if the user has no rights to use
11130 <title><structname>pg_user_mappings</structname> Columns</title>
11135 <entry>Name</entry>
11136 <entry>Type</entry>
11137 <entry>References</entry>
11138 <entry>Description</entry>
11144 <entry><structfield>umid</structfield></entry>
11145 <entry><type>oid</type></entry>
11146 <entry><literal><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>.oid</literal></entry>
11147 <entry>OID of the user mapping</entry>
11151 <entry><structfield>srvid</structfield></entry>
11152 <entry><type>oid</type></entry>
11153 <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
11155 The OID of the foreign server that contains this mapping
11160 <entry><structfield>srvname</structfield></entry>
11161 <entry><type>name</type></entry>
11162 <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.srvname</literal></entry>
11164 Name of the foreign server
11169 <entry><structfield>umuser</structfield></entry>
11170 <entry><type>oid</type></entry>
11171 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
11172 <entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
11176 <entry><structfield>usename</structfield></entry>
11177 <entry><type>name</type></entry>
11179 <entry>Name of the local user to be mapped</entry>
11183 <entry><structfield>umoptions</structfield></entry>
11184 <entry><type>text[]</type></entry>
11187 User mapping specific options, as <quote>keyword=value</quote> strings
11195 To protect password information stored as a user mapping option,
11196 the <structfield>umoptions</structfield> column will read as null
11197 unless one of the following applies:
11201 current user is the user being mapped, and owns the server or
11202 holds <literal>USAGE</literal> privilege on it
11207 current user is the server owner and mapping is for <literal>PUBLIC</literal>
11212 current user is a superuser
11221 <sect1 id="view-pg-views">
11222 <title><structname>pg_views</structname></title>
11224 <indexterm zone="view-pg-views">
11225 <primary>pg_views</primary>
11229 The view <structname>pg_views</structname> provides access to
11230 useful information about each view in the database.
11234 <title><structname>pg_views</structname> Columns</title>
11239 <entry>Name</entry>
11240 <entry>Type</entry>
11241 <entry>References</entry>
11242 <entry>Description</entry>
11247 <entry><structfield>schemaname</structfield></entry>
11248 <entry><type>name</type></entry>
11249 <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
11250 <entry>Name of schema containing view</entry>
11253 <entry><structfield>viewname</structfield></entry>
11254 <entry><type>name</type></entry>
11255 <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
11256 <entry>Name of view</entry>
11259 <entry><structfield>viewowner</structfield></entry>
11260 <entry><type>name</type></entry>
11261 <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
11262 <entry>Name of view's owner</entry>
11265 <entry><structfield>definition</structfield></entry>
11266 <entry><type>text</type></entry>
11268 <entry>View definition (a reconstructed <command>SELECT</command> query)</entry>