1 <!-- doc/src/sgml/system-views.sgml -->
3 Documentation of the system views, directed toward PostgreSQL developers
7 <title>System Views
</title>
10 In addition to the system catalogs,
<productname>PostgreSQL
</productname>
11 provides a number of built-in views. Some system views provide convenient
12 access to some commonly used queries on the system catalogs. Other views
13 provide access to internal server state.
17 The information schema (
<xref linkend=
"information-schema"/>) provides
18 an alternative set of views which overlap the functionality of the system
19 views. Since the information schema is SQL-standard whereas the views
20 described here are
<productname>PostgreSQL
</productname>-specific,
21 it's usually better to use the information schema if it provides all
22 the information you need.
26 <xref linkend=
"view-table"/> lists the system views described here.
27 More detailed documentation of each view follows below.
28 There are some additional views that provide access to accumulated
29 statistics; they are described in
30 <xref linkend=
"monitoring-stats-views-table"/>.
33 <sect1 id=
"views-overview">
34 <title>Overview
</title>
37 <xref linkend=
"view-table"/> lists the system views.
38 More detailed documentation of each catalog follows below.
39 Except where noted, all the views described here are read-only.
42 <table id=
"view-table">
43 <title>System Views
</title>
48 <entry>View Name
</entry>
49 <entry>Purpose
</entry>
55 <entry><link linkend=
"view-pg-available-extensions"><structname>pg_available_extensions
</structname></link></entry>
56 <entry>available extensions
</entry>
60 <entry><link linkend=
"view-pg-available-extension-versions"><structname>pg_available_extension_versions
</structname></link></entry>
61 <entry>available versions of extensions
</entry>
65 <entry><link linkend=
"view-pg-backend-memory-contexts"><structname>pg_backend_memory_contexts
</structname></link></entry>
66 <entry>backend memory contexts
</entry>
70 <entry><link linkend=
"view-pg-config"><structname>pg_config
</structname></link></entry>
71 <entry>compile-time configuration parameters
</entry>
75 <entry><link linkend=
"view-pg-cursors"><structname>pg_cursors
</structname></link></entry>
76 <entry>open cursors
</entry>
80 <entry><link linkend=
"view-pg-file-settings"><structname>pg_file_settings
</structname></link></entry>
81 <entry>summary of configuration file contents
</entry>
85 <entry><link linkend=
"view-pg-group"><structname>pg_group
</structname></link></entry>
86 <entry>groups of database users
</entry>
90 <entry><link linkend=
"view-pg-hba-file-rules"><structname>pg_hba_file_rules
</structname></link></entry>
91 <entry>summary of client authentication configuration file contents
</entry>
95 <entry><link linkend=
"view-pg-ident-file-mappings"><structname>pg_ident_file_mappings
</structname></link></entry>
96 <entry>summary of client user name mapping configuration file contents
</entry>
100 <entry><link linkend=
"view-pg-indexes"><structname>pg_indexes
</structname></link></entry>
101 <entry>indexes
</entry>
105 <entry><link linkend=
"view-pg-locks"><structname>pg_locks
</structname></link></entry>
106 <entry>locks currently held or awaited
</entry>
110 <entry><link linkend=
"view-pg-matviews"><structname>pg_matviews
</structname></link></entry>
111 <entry>materialized views
</entry>
115 <entry><link linkend=
"view-pg-policies"><structname>pg_policies
</structname></link></entry>
116 <entry>policies
</entry>
120 <entry><link linkend=
"view-pg-prepared-statements"><structname>pg_prepared_statements
</structname></link></entry>
121 <entry>prepared statements
</entry>
125 <entry><link linkend=
"view-pg-prepared-xacts"><structname>pg_prepared_xacts
</structname></link></entry>
126 <entry>prepared transactions
</entry>
130 <entry><link linkend=
"view-pg-publication-tables"><structname>pg_publication_tables
</structname></link></entry>
131 <entry>publications and information of their associated tables
</entry>
135 <entry><link linkend=
"view-pg-replication-origin-status"><structname>pg_replication_origin_status
</structname></link></entry>
136 <entry>information about replication origins, including replication progress
</entry>
140 <entry><link linkend=
"view-pg-replication-slots"><structname>pg_replication_slots
</structname></link></entry>
141 <entry>replication slot information
</entry>
145 <entry><link linkend=
"view-pg-roles"><structname>pg_roles
</structname></link></entry>
146 <entry>database roles
</entry>
150 <entry><link linkend=
"view-pg-rules"><structname>pg_rules
</structname></link></entry>
155 <entry><link linkend=
"view-pg-seclabels"><structname>pg_seclabels
</structname></link></entry>
156 <entry>security labels
</entry>
160 <entry><link linkend=
"view-pg-sequences"><structname>pg_sequences
</structname></link></entry>
161 <entry>sequences
</entry>
165 <entry><link linkend=
"view-pg-settings"><structname>pg_settings
</structname></link></entry>
166 <entry>parameter settings
</entry>
170 <entry><link linkend=
"view-pg-shadow"><structname>pg_shadow
</structname></link></entry>
171 <entry>database users
</entry>
175 <entry><link linkend=
"view-pg-shmem-allocations"><structname>pg_shmem_allocations
</structname></link></entry>
176 <entry>shared memory allocations
</entry>
180 <entry><link linkend=
"view-pg-stats"><structname>pg_stats
</structname></link></entry>
181 <entry>planner statistics
</entry>
185 <entry><link linkend=
"view-pg-stats-ext"><structname>pg_stats_ext
</structname></link></entry>
186 <entry>extended planner statistics
</entry>
190 <entry><link linkend=
"view-pg-stats-ext-exprs"><structname>pg_stats_ext_exprs
</structname></link></entry>
191 <entry>extended planner statistics for expressions
</entry>
195 <entry><link linkend=
"view-pg-tables"><structname>pg_tables
</structname></link></entry>
196 <entry>tables
</entry>
200 <entry><link linkend=
"view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs
</structname></link></entry>
201 <entry>time zone abbreviations
</entry>
205 <entry><link linkend=
"view-pg-timezone-names"><structname>pg_timezone_names
</structname></link></entry>
206 <entry>time zone names
</entry>
210 <entry><link linkend=
"view-pg-user"><structname>pg_user
</structname></link></entry>
211 <entry>database users
</entry>
215 <entry><link linkend=
"view-pg-user-mappings"><structname>pg_user_mappings
</structname></link></entry>
216 <entry>user mappings
</entry>
220 <entry><link linkend=
"view-pg-views"><structname>pg_views
</structname></link></entry>
225 <entry><link linkend=
"view-pg-wait-events"><structname>pg_wait_events
</structname></link></entry>
226 <entry>wait events
</entry>
234 <sect1 id=
"view-pg-available-extensions">
235 <title><structname>pg_available_extensions
</structname></title>
237 <indexterm zone=
"view-pg-available-extensions">
238 <primary>pg_available_extensions
</primary>
242 The
<structname>pg_available_extensions
</structname> view lists the
243 extensions that are available for installation.
245 <link linkend=
"catalog-pg-extension"><structname>pg_extension
</structname></link>
246 catalog, which shows the extensions currently installed.
250 <title><structname>pg_available_extensions
</structname> Columns
</title>
254 <entry role=
"catalog_table_entry"><para role=
"column_definition">
265 <entry role=
"catalog_table_entry"><para role=
"column_definition">
266 <structfield>name
</structfield> <type>name
</type>
274 <entry role=
"catalog_table_entry"><para role=
"column_definition">
275 <structfield>default_version
</structfield> <type>text
</type>
278 Name of default version, or
<literal>NULL
</literal> if none is
284 <entry role=
"catalog_table_entry"><para role=
"column_definition">
285 <structfield>installed_version
</structfield> <type>text
</type>
288 Currently installed version of the extension,
289 or
<literal>NULL
</literal> if not installed
294 <entry role=
"catalog_table_entry"><para role=
"column_definition">
295 <structfield>comment
</structfield> <type>text
</type>
298 Comment string from the extension's control file
306 The
<structname>pg_available_extensions
</structname> view is read-only.
310 <sect1 id=
"view-pg-available-extension-versions">
311 <title><structname>pg_available_extension_versions
</structname></title>
313 <indexterm zone=
"view-pg-available-extension-versions">
314 <primary>pg_available_extension_versions
</primary>
318 The
<structname>pg_available_extension_versions
</structname> view lists the
319 specific extension versions that are available for installation.
321 linkend=
"catalog-pg-extension"><structname>pg_extension
</structname></link>
322 catalog, which shows the extensions currently installed.
326 <title><structname>pg_available_extension_versions
</structname> Columns
</title>
330 <entry role=
"catalog_table_entry"><para role=
"column_definition">
341 <entry role=
"catalog_table_entry"><para role=
"column_definition">
342 <structfield>name
</structfield> <type>name
</type>
350 <entry role=
"catalog_table_entry"><para role=
"column_definition">
351 <structfield>version
</structfield> <type>text
</type>
359 <entry role=
"catalog_table_entry"><para role=
"column_definition">
360 <structfield>installed
</structfield> <type>bool
</type>
363 True if this version of this extension is currently
369 <entry role=
"catalog_table_entry"><para role=
"column_definition">
370 <structfield>superuser
</structfield> <type>bool
</type>
373 True if only superusers are allowed to install this extension
374 (but see
<structfield>trusted
</structfield>)
379 <entry role=
"catalog_table_entry"><para role=
"column_definition">
380 <structfield>trusted
</structfield> <type>bool
</type>
383 True if the extension can be installed by non-superusers
384 with appropriate privileges
389 <entry role=
"catalog_table_entry"><para role=
"column_definition">
390 <structfield>relocatable
</structfield> <type>bool
</type>
393 True if extension can be relocated to another schema
398 <entry role=
"catalog_table_entry"><para role=
"column_definition">
399 <structfield>schema
</structfield> <type>name
</type>
402 Name of the schema that the extension must be installed into,
403 or
<literal>NULL
</literal> if partially or fully relocatable
408 <entry role=
"catalog_table_entry"><para role=
"column_definition">
409 <structfield>requires
</structfield> <type>name[]
</type>
412 Names of prerequisite extensions,
413 or
<literal>NULL
</literal> if none
418 <entry role=
"catalog_table_entry"><para role=
"column_definition">
419 <structfield>comment
</structfield> <type>text
</type>
422 Comment string from the extension's control file
430 The
<structname>pg_available_extension_versions
</structname> view is
435 <sect1 id=
"view-pg-backend-memory-contexts">
436 <title><structname>pg_backend_memory_contexts
</structname></title>
438 <indexterm zone=
"view-pg-backend-memory-contexts">
439 <primary>pg_backend_memory_contexts
</primary>
443 The view
<structname>pg_backend_memory_contexts
</structname> displays all
444 the memory contexts of the server process attached to the current session.
447 <structname>pg_backend_memory_contexts
</structname> contains one row
448 for each memory context.
452 <title><structname>pg_backend_memory_contexts
</structname> Columns
</title>
456 <entry role=
"catalog_table_entry"><para role=
"column_definition">
467 <entry role=
"catalog_table_entry"><para role=
"column_definition">
468 <structfield>name
</structfield> <type>text
</type>
471 Name of the memory context
476 <entry role=
"catalog_table_entry"><para role=
"column_definition">
477 <structfield>ident
</structfield> <type>text
</type>
480 Identification information of the memory context. This field is truncated at
1024 bytes
485 <entry role=
"catalog_table_entry"><para role=
"column_definition">
486 <structfield>type
</structfield> <type>text
</type>
489 Type of the memory context
494 <entry role=
"catalog_table_entry"><para role=
"column_definition">
495 <structfield>level
</structfield> <type>int4
</type>
498 The
1-based level of the context in the memory context hierarchy. The
499 level of a context also shows the position of that context in the
500 <structfield>path
</structfield> column.
505 <entry role=
"catalog_table_entry"><para role=
"column_definition">
506 <structfield>path
</structfield> <type>int4[]
</type>
509 Array of transient numerical identifiers to describe the memory
510 context hierarchy. The first element is for
511 <literal>TopMemoryContext
</literal>, subsequent elements contain
512 intermediate parents and the final element contains the identifier for
518 <entry role=
"catalog_table_entry"><para role=
"column_definition">
519 <structfield>total_bytes
</structfield> <type>int8
</type>
522 Total bytes allocated for this memory context
527 <entry role=
"catalog_table_entry"><para role=
"column_definition">
528 <structfield>total_nblocks
</structfield> <type>int8
</type>
531 Total number of blocks allocated for this memory context
536 <entry role=
"catalog_table_entry"><para role=
"column_definition">
537 <structfield>free_bytes
</structfield> <type>int8
</type>
545 <entry role=
"catalog_table_entry"><para role=
"column_definition">
546 <structfield>free_chunks
</structfield> <type>int8
</type>
549 Total number of free chunks
554 <entry role=
"catalog_table_entry"><para role=
"column_definition">
555 <structfield>used_bytes
</structfield> <type>int8
</type>
566 By default, the
<structname>pg_backend_memory_contexts
</structname> view can be
567 read only by superusers or roles with the privileges of the
568 <literal>pg_read_all_stats
</literal> role.
572 Since memory contexts are created and destroyed during the running of a
573 query, the identifiers stored in the
<structfield>path
</structfield> column
574 can be unstable between multiple invocations of the view in the same query.
575 The example below demonstrates an effective usage of this column and
576 calculates the total number of bytes used by
577 <literal>CacheMemoryContext
</literal> and all of its children:
580 WITH memory_contexts AS (
581 SELECT * FROM pg_backend_memory_contexts
583 SELECT sum(c1.total_bytes)
584 FROM memory_contexts c1, memory_contexts c2
585 WHERE c2.name = 'CacheMemoryContext'
586 AND c1.path[c2.level] = c2.path[c2.level];
589 The
<link linkend=
"queries-with">Common Table Expression
</link> is used
590 to ensure the context IDs in the
<structfield>path
</structfield> column
591 match between both evaluations of the view.
595 <sect1 id=
"view-pg-config">
596 <title><structname>pg_config
</structname></title>
598 <indexterm zone=
"view-pg-config">
599 <primary>pg_config
</primary>
603 The view
<structname>pg_config
</structname> describes the
604 compile-time configuration parameters of the currently installed
605 version of
<productname>PostgreSQL
</productname>. It is intended, for example, to
606 be used by software packages that want to interface to
607 <productname>PostgreSQL
</productname> to facilitate finding the required header
608 files and libraries. It provides the same basic information as the
609 <xref linkend=
"app-pgconfig"/> <productname>PostgreSQL
</productname> client
614 By default, the
<structname>pg_config
</structname> view can be read
619 <title><structname>pg_config
</structname> Columns
</title>
623 <entry role=
"catalog_table_entry"><para role=
"column_definition">
634 <entry role=
"catalog_table_entry"><para role=
"column_definition">
635 <structfield>name
</structfield> <type>text
</type>
643 <entry role=
"catalog_table_entry"><para role=
"column_definition">
644 <structfield>setting
</structfield> <type>text
</type>
656 <sect1 id=
"view-pg-cursors">
657 <title><structname>pg_cursors
</structname></title>
659 <indexterm zone=
"view-pg-cursors">
660 <primary>pg_cursors
</primary>
664 The
<structname>pg_cursors
</structname> view lists the cursors that
665 are currently available. Cursors can be defined in several ways:
669 via the
<link linkend=
"sql-declare"><command>DECLARE
</command></link>
676 via the Bind message in the frontend/backend protocol, as
677 described in
<xref linkend=
"protocol-flow-ext-query"/>
683 via the Server Programming Interface (SPI), as described in
684 <xref linkend=
"spi-interface"/>
689 The
<structname>pg_cursors
</structname> view displays cursors
690 created by any of these means. Cursors only exist for the duration
691 of the transaction that defines them, unless they have been
692 declared
<literal>WITH HOLD
</literal>. Therefore non-holdable
693 cursors are only present in the view until the end of their
694 creating transaction.
698 Cursors are used internally to implement some of the components
699 of
<productname>PostgreSQL
</productname>, such as procedural languages.
700 Therefore, the
<structname>pg_cursors
</structname> view might include cursors
701 that have not been explicitly created by the user.
707 <title><structname>pg_cursors
</structname> Columns
</title>
711 <entry role=
"catalog_table_entry"><para role=
"column_definition">
722 <entry role=
"catalog_table_entry"><para role=
"column_definition">
723 <structfield>name
</structfield> <type>text
</type>
726 The name of the cursor
731 <entry role=
"catalog_table_entry"><para role=
"column_definition">
732 <structfield>statement
</structfield> <type>text
</type>
735 The verbatim query string submitted to declare this cursor
740 <entry role=
"catalog_table_entry"><para role=
"column_definition">
741 <structfield>is_holdable
</structfield> <type>bool
</type>
744 <literal>true
</literal> if the cursor is holdable (that is, it
745 can be accessed after the transaction that declared the cursor
746 has committed);
<literal>false
</literal> otherwise
751 <entry role=
"catalog_table_entry"><para role=
"column_definition">
752 <structfield>is_binary
</structfield> <type>bool
</type>
755 <literal>true
</literal> if the cursor was declared
756 <literal>BINARY
</literal>;
<literal>false
</literal>
762 <entry role=
"catalog_table_entry"><para role=
"column_definition">
763 <structfield>is_scrollable
</structfield> <type>bool
</type>
766 <literal>true
</literal> if the cursor is scrollable (that is, it
767 allows rows to be retrieved in a nonsequential manner);
768 <literal>false
</literal> otherwise
773 <entry role=
"catalog_table_entry"><para role=
"column_definition">
774 <structfield>creation_time
</structfield> <type>timestamptz
</type>
777 The time at which the cursor was declared
785 The
<structname>pg_cursors
</structname> view is read-only.
790 <sect1 id=
"view-pg-file-settings">
791 <title><structname>pg_file_settings
</structname></title>
793 <indexterm zone=
"view-pg-file-settings">
794 <primary>pg_file_settings
</primary>
798 The view
<structname>pg_file_settings
</structname> provides a summary of
799 the contents of the server's configuration file(s). A row appears in
800 this view for each
<quote>name = value
</quote> entry appearing in the files,
801 with annotations indicating whether the value could be applied
802 successfully. Additional row(s) may appear for problems not linked to
803 a
<quote>name = value
</quote> entry, such as syntax errors in the files.
807 This view is helpful for checking whether planned changes in the
808 configuration files will work, or for diagnosing a previous failure.
809 Note that this view reports on the
<emphasis>current
</emphasis> contents of the
810 files, not on what was last applied by the server. (The
811 <link linkend=
"view-pg-settings"><structname>pg_settings
</structname></link>
812 view is usually sufficient to determine that.)
816 By default, the
<structname>pg_file_settings
</structname> view can be read
821 <title><structname>pg_file_settings
</structname> Columns
</title>
825 <entry role=
"catalog_table_entry"><para role=
"column_definition">
836 <entry role=
"catalog_table_entry"><para role=
"column_definition">
837 <structfield>sourcefile
</structfield> <type>text
</type>
840 Full path name of the configuration file
845 <entry role=
"catalog_table_entry"><para role=
"column_definition">
846 <structfield>sourceline
</structfield> <type>int4
</type>
849 Line number within the configuration file where the entry appears
854 <entry role=
"catalog_table_entry"><para role=
"column_definition">
855 <structfield>seqno
</structfield> <type>int4
</type>
858 Order in which the entries are processed (
1..
<replaceable>n
</replaceable>)
863 <entry role=
"catalog_table_entry"><para role=
"column_definition">
864 <structfield>name
</structfield> <type>text
</type>
867 Configuration parameter name
872 <entry role=
"catalog_table_entry"><para role=
"column_definition">
873 <structfield>setting
</structfield> <type>text
</type>
876 Value to be assigned to the parameter
881 <entry role=
"catalog_table_entry"><para role=
"column_definition">
882 <structfield>applied
</structfield> <type>bool
</type>
885 True if the value can be applied successfully
890 <entry role=
"catalog_table_entry"><para role=
"column_definition">
891 <structfield>error
</structfield> <type>text
</type>
894 If not null, an error message indicating why this entry could
903 If the configuration file contains syntax errors or invalid parameter
904 names, the server will not attempt to apply any settings from it, and
905 therefore all the
<structfield>applied
</structfield> fields will read as false.
906 In such a case there will be one or more rows with
907 non-null
<structfield>error
</structfield> fields indicating the
908 problem(s). Otherwise, individual settings will be applied if possible.
909 If an individual setting cannot be applied (e.g., invalid value, or the
910 setting cannot be changed after server start) it will have an appropriate
911 message in the
<structfield>error
</structfield> field. Another way that
912 an entry might have
<structfield>applied
</structfield> = false is that it is
913 overridden by a later entry for the same parameter name; this case is not
914 considered an error so nothing appears in
915 the
<structfield>error
</structfield> field.
919 See
<xref linkend=
"config-setting"/> for more information about the various
920 ways to change run-time parameters.
925 <sect1 id=
"view-pg-group">
926 <title><structname>pg_group
</structname></title>
928 <indexterm zone=
"view-pg-group">
929 <primary>pg_group
</primary>
932 <!-- Unlike information_schema.applicable_roles, this shows no members for
933 pg_database_owner. The v8.1 catalog would have shown no members if
934 that role had existed at the time. -->
936 The view
<structname>pg_group
</structname> exists for backwards
937 compatibility: it emulates a catalog that existed in
938 <productname>PostgreSQL
</productname> before version
8.1.
939 It shows the names and members of all roles that are marked as not
940 <structfield>rolcanlogin
</structfield>, which is an approximation to the set
941 of roles that are being used as groups.
945 <title><structname>pg_group
</structname> Columns
</title>
949 <entry role=
"catalog_table_entry"><para role=
"column_definition">
960 <entry role=
"catalog_table_entry"><para role=
"column_definition">
961 <structfield>groname
</structfield> <type>name
</type>
962 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
970 <entry role=
"catalog_table_entry"><para role=
"column_definition">
971 <structfield>grosysid
</structfield> <type>oid
</type>
972 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>oid
</structfield>)
980 <entry role=
"catalog_table_entry"><para role=
"column_definition">
981 <structfield>grolist
</structfield> <type>oid[]
</type>
982 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>oid
</structfield>)
985 An array containing the IDs of the roles in this group
994 <sect1 id=
"view-pg-hba-file-rules">
995 <title><structname>pg_hba_file_rules
</structname></title>
997 <indexterm zone=
"view-pg-hba-file-rules">
998 <primary>pg_hba_file_rules
</primary>
1002 The view
<structname>pg_hba_file_rules
</structname> provides a summary of
1003 the contents of the client authentication configuration file,
1004 <link linkend=
"auth-pg-hba-conf"><filename>pg_hba.conf
</filename></link>.
1005 A row appears in this view for each
1006 non-empty, non-comment line in the file, with annotations indicating
1007 whether the rule could be applied successfully.
1011 This view can be helpful for checking whether planned changes in the
1012 authentication configuration file will work, or for diagnosing a previous
1013 failure. Note that this view reports on the
<emphasis>current
</emphasis> contents
1014 of the file, not on what was last loaded by the server.
1018 By default, the
<structname>pg_hba_file_rules
</structname> view can be read
1023 <title><structname>pg_hba_file_rules
</structname> Columns
</title>
1027 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1038 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1039 <structfield>rule_number
</structfield> <type>int4
</type>
1042 Number of this rule, if valid, otherwise
<literal>NULL
</literal>.
1043 This indicates the order in which each rule is considered
1044 until a match is found during authentication.
1049 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1050 <structfield>file_name
</structfield> <type>text
</type>
1053 Name of the file containing this rule
1058 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1059 <structfield>line_number
</structfield> <type>int4
</type>
1062 Line number of this rule in
<literal>file_name
</literal>
1067 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1068 <structfield>type
</structfield> <type>text
</type>
1076 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1077 <structfield>database
</structfield> <type>text[]
</type>
1080 List of database name(s) to which this rule applies
1085 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1086 <structfield>user_name
</structfield> <type>text[]
</type>
1089 List of user and group name(s) to which this rule applies
1094 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1095 <structfield>address
</structfield> <type>text
</type>
1098 Host name or IP address, or one
1099 of
<literal>all
</literal>,
<literal>samehost
</literal>,
1100 or
<literal>samenet
</literal>, or null for local connections
1105 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1106 <structfield>netmask
</structfield> <type>text
</type>
1109 IP address mask, or null if not applicable
1114 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1115 <structfield>auth_method
</structfield> <type>text
</type>
1118 Authentication method
1123 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1124 <structfield>options
</structfield> <type>text[]
</type>
1127 Options specified for authentication method, if any
1132 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1133 <structfield>error
</structfield> <type>text
</type>
1136 If not null, an error message indicating why this
1137 line could not be processed
1145 Usually, a row reflecting an incorrect entry will have values for only
1146 the
<structfield>line_number
</structfield> and
<structfield>error
</structfield> fields.
1150 See
<xref linkend=
"client-authentication"/> for more information about
1151 client authentication configuration.
1155 <sect1 id=
"view-pg-ident-file-mappings">
1156 <title><structname>pg_ident_file_mappings
</structname></title>
1158 <indexterm zone=
"view-pg-ident-file-mappings">
1159 <primary>pg_ident_file_mappings
</primary>
1163 The view
<structname>pg_ident_file_mappings
</structname> provides a summary
1164 of the contents of the client user name mapping configuration file,
1165 <link linkend=
"auth-username-maps"><filename>pg_ident.conf
</filename></link>.
1166 A row appears in this view for each non-empty, non-comment line in the file,
1167 with annotations indicating whether the map could be applied successfully.
1171 This view can be helpful for checking whether planned changes in the
1172 authentication configuration file will work, or for diagnosing a previous
1173 failure. Note that this view reports on the
<emphasis>current
</emphasis>
1174 contents of the file, not on what was last loaded by the server.
1178 By default, the
<structname>pg_ident_file_mappings
</structname> view can be
1179 read only by superusers.
1183 <title><structname>pg_ident_file_mappings
</structname> Columns
</title> <tgroup
1187 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1198 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1199 <structfield>map_number
</structfield> <type>int4
</type>
1202 Number of this map, in priority order, if valid, otherwise
1203 <literal>NULL
</literal>
1208 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1209 <structfield>file_name
</structfield> <type>text
</type>
1212 Name of the file containing this map
1217 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1218 <structfield>line_number
</structfield> <type>int4
</type>
1221 Line number of this map in
<literal>file_name
</literal>
1226 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1227 <structfield>map_name
</structfield> <type>text
</type>
1235 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1236 <structfield>sys_name
</structfield> <type>text
</type>
1239 Detected user name of the client
1244 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1245 <structfield>pg_username
</structfield> <type>text
</type>
1248 Requested PostgreSQL user name
1253 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1254 <structfield>error
</structfield> <type>text
</type>
1257 If not
<literal>NULL
</literal>, an error message indicating why this
1258 line could not be processed
1266 Usually, a row reflecting an incorrect entry will have values for only
1267 the
<structfield>line_number
</structfield> and
<structfield>error
</structfield> fields.
1271 See
<xref linkend=
"client-authentication"/> for more information about
1272 client authentication configuration.
1276 <sect1 id=
"view-pg-indexes">
1277 <title><structname>pg_indexes
</structname></title>
1279 <indexterm zone=
"view-pg-indexes">
1280 <primary>pg_indexes
</primary>
1284 The view
<structname>pg_indexes
</structname> provides access to
1285 useful information about each index in the database.
1289 <title><structname>pg_indexes
</structname> Columns
</title>
1293 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1304 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1305 <structfield>schemaname
</structfield> <type>name
</type>
1306 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
1309 Name of schema containing table and index
1314 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1315 <structfield>tablename
</structfield> <type>name
</type>
1316 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
1319 Name of table the index is for
1324 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1325 <structfield>indexname
</structfield> <type>name
</type>
1326 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
1334 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1335 <structfield>tablespace
</structfield> <type>name
</type>
1336 (references
<link linkend=
"catalog-pg-tablespace"><structname>pg_tablespace
</structname></link>.
<structfield>spcname
</structfield>)
1339 Name of tablespace containing index (null if default for database)
1344 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1345 <structfield>indexdef
</structfield> <type>text
</type>
1348 Index definition (a reconstructed
<xref linkend=
"sql-createindex"/>
1358 <sect1 id=
"view-pg-locks">
1359 <title><structname>pg_locks
</structname></title>
1361 <indexterm zone=
"view-pg-locks">
1362 <primary>pg_locks
</primary>
1366 The view
<structname>pg_locks
</structname> provides access to
1367 information about the locks held by active processes within the
1368 database server. See
<xref linkend=
"mvcc"/> for more discussion
1373 <structname>pg_locks
</structname> contains one row per active lockable
1374 object, requested lock mode, and relevant process. Thus, the same
1375 lockable object might
1376 appear many times, if multiple processes are holding or waiting
1377 for locks on it. However, an object that currently has no locks on it
1378 will not appear at all.
1382 There are several distinct types of lockable objects:
1383 whole relations (e.g., tables), individual pages of relations,
1384 individual tuples of relations,
1385 transaction IDs (both virtual and permanent IDs),
1386 and general database objects (identified by class OID and object OID,
1387 in the same way as in
<link linkend=
"catalog-pg-description"><structname>pg_description
</structname></link> or
1388 <link linkend=
"catalog-pg-depend"><structname>pg_depend
</structname></link>). Also, the right to extend a
1389 relation is represented as a separate lockable object, as is the right to
1390 update
<structname>pg_database
</structname>.
<structfield>datfrozenxid
</structfield>.
1391 Also,
<quote>advisory
</quote> locks can be taken on numbers that have
1392 user-defined meanings.
1396 <title><structname>pg_locks
</structname> Columns
</title>
1400 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1411 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1412 <structfield>locktype
</structfield> <type>text
</type>
1415 Type of the lockable object:
1416 <literal>relation
</literal>,
1417 <literal>extend
</literal>,
1418 <literal>frozenid
</literal>,
1419 <literal>page
</literal>,
1420 <literal>tuple
</literal>,
1421 <literal>transactionid
</literal>,
1422 <literal>virtualxid
</literal>,
1423 <literal>spectoken
</literal>,
1424 <literal>object
</literal>,
1425 <literal>userlock
</literal>,
1426 <literal>advisory
</literal>, or
1427 <literal>applytransaction
</literal>.
1428 (See also
<xref linkend=
"wait-event-lock-table"/>.)
1433 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1434 <structfield>database
</structfield> <type>oid
</type>
1435 (references
<link linkend=
"catalog-pg-database"><structname>pg_database
</structname></link>.
<structfield>oid
</structfield>)
1438 OID of the database in which the lock target exists, or
1439 zero if the target is a shared object, or
1440 null if the target is a transaction ID
1445 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1446 <structfield>relation
</structfield> <type>oid
</type>
1447 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>oid
</structfield>)
1450 OID of the relation targeted by the lock, or null if the target is not
1451 a relation or part of a relation
1456 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1457 <structfield>page
</structfield> <type>int4
</type>
1460 Page number targeted by the lock within the relation,
1461 or null if the target is not a relation page or tuple
1466 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1467 <structfield>tuple
</structfield> <type>int2
</type>
1470 Tuple number targeted by the lock within the page,
1471 or null if the target is not a tuple
1476 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1477 <structfield>virtualxid
</structfield> <type>text
</type>
1480 Virtual ID of the transaction targeted by the lock,
1481 or null if the target is not a virtual transaction ID; see
1482 <xref linkend=
"transactions"/>
1487 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1488 <structfield>transactionid
</structfield> <type>xid
</type>
1491 ID of the transaction targeted by the lock, or null if the target
1492 is not a transaction ID;
<xref linkend=
"transactions"/>
1497 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1498 <structfield>classid
</structfield> <type>oid
</type>
1499 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>oid
</structfield>)
1502 OID of the system catalog containing the lock target, or null if the
1503 target is not a general database object
1508 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1509 <structfield>objid
</structfield> <type>oid
</type>
1510 (references any OID column)
1513 OID of the lock target within its system catalog, or null if the
1514 target is not a general database object
1519 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1520 <structfield>objsubid
</structfield> <type>int2
</type>
1523 Column number targeted by the lock (the
1524 <structfield>classid
</structfield> and
<structfield>objid
</structfield> refer to the
1526 or zero if the target is some other general database object,
1527 or null if the target is not a general database object
1532 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1533 <structfield>virtualtransaction
</structfield> <type>text
</type>
1536 Virtual ID of the transaction that is holding or awaiting this lock
1541 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1542 <structfield>pid
</structfield> <type>int4
</type>
1545 Process ID of the server process holding or awaiting this
1546 lock, or null if the lock is held by a prepared transaction
1551 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1552 <structfield>mode
</structfield> <type>text
</type>
1555 Name of the lock mode held or desired by this process (see
<xref linkend=
"locking-tables"/> and
<xref linkend=
"xact-serializable"/>)
1560 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1561 <structfield>granted
</structfield> <type>bool
</type>
1564 True if lock is held, false if lock is awaited
1569 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1570 <structfield>fastpath
</structfield> <type>bool
</type>
1573 True if lock was taken via fast path, false if taken via main
1579 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1580 <structfield>waitstart
</structfield> <type>timestamptz
</type>
1583 Time when the server process started waiting for this lock,
1584 or null if the lock is held.
1585 Note that this can be null for a very short period of time after
1586 the wait started even though
<structfield>granted
</structfield>
1587 is
<literal>false
</literal>.
1595 <structfield>granted
</structfield> is true in a row representing a lock
1596 held by the indicated process. False indicates that this process is
1597 currently waiting to acquire this lock, which implies that at least one
1598 other process is holding or waiting for a conflicting lock mode on the same
1599 lockable object. The waiting process will sleep until the other lock is
1600 released (or a deadlock situation is detected). A single process can be
1601 waiting to acquire at most one lock at a time.
1605 Throughout running a transaction, a server process holds an exclusive lock
1606 on the transaction's virtual transaction ID. If a permanent ID is assigned
1607 to the transaction (which normally happens only if the transaction changes
1608 the state of the database), it also holds an exclusive lock on the
1609 transaction's permanent transaction ID until it ends. When a process finds
1610 it necessary to wait specifically for another transaction to end, it does
1611 so by attempting to acquire share lock on the other transaction's ID
1612 (either virtual or permanent ID depending on the situation). That will
1613 succeed only when the other transaction terminates and releases its locks.
1617 Although tuples are a lockable type of object,
1618 information about row-level locks is stored on disk, not in memory,
1619 and therefore row-level locks normally do not appear in this view.
1620 If a process is waiting for a
1621 row-level lock, it will usually appear in the view as waiting for the
1622 permanent transaction ID of the current holder of that row lock.
1626 A speculative insertion lock consists of a transaction ID and a speculative
1627 insertion token. The speculative insertion token is displayed in the
1628 <structfield>objid
</structfield> column.
1632 Advisory locks can be acquired on keys consisting of either a single
1633 <type>bigint
</type> value or two integer values.
1634 A
<type>bigint
</type> key is displayed with its
1635 high-order half in the
<structfield>classid
</structfield> column, its low-order half
1636 in the
<structfield>objid
</structfield> column, and
<structfield>objsubid
</structfield> equal
1637 to
1. The original
<type>bigint
</type> value can be reassembled with the
1638 expression
<literal>(classid::bigint
<< 32) |
1639 objid::bigint
</literal>. Integer keys are displayed with the
1641 <structfield>classid
</structfield> column, the second key in the
<structfield>objid
</structfield>
1642 column, and
<structfield>objsubid
</structfield> equal to
2. The actual meaning of
1643 the keys is up to the user. Advisory locks are local to each database,
1644 so the
<structfield>database
</structfield> column is meaningful for an advisory lock.
1648 Apply transaction locks are used in parallel mode to apply the transaction
1649 in logical replication. The remote transaction ID is displayed in the
1650 <structfield>transactionid
</structfield> column. The
<structfield>objsubid
</structfield>
1651 displays the lock subtype which is
0 for the lock used to synchronize the
1652 set of changes, and
1 for the lock used to wait for the transaction to
1653 finish to ensure commit order.
1657 <structname>pg_locks
</structname> provides a global view of all locks
1658 in the database cluster, not only those relevant to the current database.
1659 Although its
<structfield>relation
</structfield> column can be joined
1660 against
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>oid
</structfield> to identify locked
1661 relations, this will only work correctly for relations in the current
1662 database (those for which the
<structfield>database
</structfield> column
1663 is either the current database's OID or zero).
1667 The
<structfield>pid
</structfield> column can be joined to the
1668 <structfield>pid
</structfield> column of the
1669 <link linkend=
"monitoring-pg-stat-activity-view">
1670 <structname>pg_stat_activity
</structname></link>
1672 information on the session holding or awaiting each lock,
1675 SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa
1676 ON pl.pid = psa.pid;
1678 Also, if you are using prepared transactions, the
1679 <structfield>virtualtransaction
</structfield> column can be joined to the
1680 <structfield>transaction
</structfield> column of the
<link
1681 linkend=
"view-pg-prepared-xacts"><structname>pg_prepared_xacts
</structname></link>
1682 view to get more information on prepared transactions that hold locks.
1683 (A prepared transaction can never be waiting for a lock,
1684 but it continues to hold the locks it acquired while running.)
1687 SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
1688 ON pl.virtualtransaction = '-
1/' || ppx.transaction;
1693 While it is possible to obtain information about which processes block
1694 which other processes by joining
<structname>pg_locks
</structname> against
1695 itself, this is very difficult to get right in detail. Such a query would
1696 have to encode knowledge about which lock modes conflict with which
1697 others. Worse, the
<structname>pg_locks
</structname> view does not expose
1698 information about which processes are ahead of which others in lock wait
1699 queues, nor information about which processes are parallel workers running
1700 on behalf of which other client sessions. It is better to use
1701 the
<function>pg_blocking_pids()
</function> function
1702 (see
<xref linkend=
"functions-info-session-table"/>) to identify which
1703 process(es) a waiting process is blocked behind.
1707 The
<structname>pg_locks
</structname> view displays data from both the
1708 regular lock manager and the predicate lock manager, which are
1709 separate systems; in addition, the regular lock manager subdivides its
1710 locks into regular and
<firstterm>fast-path
</firstterm> locks.
1711 This data is not guaranteed to be entirely consistent.
1712 When the view is queried,
1713 data on fast-path locks (with
<structfield>fastpath
</structfield> =
<literal>true
</literal>)
1714 is gathered from each backend one at a time, without freezing the state of
1715 the entire lock manager, so it is possible for locks to be taken or
1716 released while information is gathered. Note, however, that these locks are
1717 known not to conflict with any other lock currently in place. After
1718 all backends have been queried for fast-path locks, the remainder of the
1719 regular lock manager is locked as a unit, and a consistent snapshot of all
1720 remaining locks is collected as an atomic action. After unlocking the
1721 regular lock manager, the predicate lock manager is similarly locked and all
1722 predicate locks are collected as an atomic action. Thus, with the exception
1723 of fast-path locks, each lock manager will deliver a consistent set of
1724 results, but as we do not lock both lock managers simultaneously, it is
1725 possible for locks to be taken or released after we interrogate the regular
1726 lock manager and before we interrogate the predicate lock manager.
1730 Locking the regular and/or predicate lock manager could have some
1731 impact on database performance if this view is very frequently accessed.
1732 The locks are held only for the minimum amount of time necessary to
1733 obtain data from the lock managers, but this does not completely eliminate
1734 the possibility of a performance impact.
1739 <sect1 id=
"view-pg-matviews">
1740 <title><structname>pg_matviews
</structname></title>
1742 <indexterm zone=
"view-pg-matviews">
1743 <primary>pg_matviews
</primary>
1746 <indexterm zone=
"view-pg-matviews">
1747 <primary>materialized views
</primary>
1751 The view
<structname>pg_matviews
</structname> provides access to
1752 useful information about each materialized view in the database.
1756 <title><structname>pg_matviews
</structname> Columns
</title>
1760 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1771 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1772 <structfield>schemaname
</structfield> <type>name
</type>
1773 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
1776 Name of schema containing materialized view
1781 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1782 <structfield>matviewname
</structfield> <type>name
</type>
1783 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
1786 Name of materialized view
1791 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1792 <structfield>matviewowner
</structfield> <type>name
</type>
1793 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
1796 Name of materialized view's owner
1801 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1802 <structfield>tablespace
</structfield> <type>name
</type>
1803 (references
<link linkend=
"catalog-pg-tablespace"><structname>pg_tablespace
</structname></link>.
<structfield>spcname
</structfield>)
1806 Name of tablespace containing materialized view (null if default for database)
1811 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1812 <structfield>hasindexes
</structfield> <type>bool
</type>
1815 True if materialized view has (or recently had) any indexes
1820 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1821 <structfield>ispopulated
</structfield> <type>bool
</type>
1824 True if materialized view is currently populated
1829 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1830 <structfield>definition
</structfield> <type>text
</type>
1833 Materialized view definition (a reconstructed
<xref linkend=
"sql-select"/> query)
1842 <sect1 id=
"view-pg-policies">
1843 <title><structname>pg_policies
</structname></title>
1845 <indexterm zone=
"view-pg-policies">
1846 <primary>pg_policies
</primary>
1850 The view
<structname>pg_policies
</structname> provides access to
1851 useful information about each row-level security policy in the database.
1855 <title><structname>pg_policies
</structname> Columns
</title>
1859 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1870 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1871 <structfield>schemaname
</structfield> <type>name
</type>
1872 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
1875 Name of schema containing table policy is on
1880 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1881 <structfield>tablename
</structfield> <type>name
</type>
1882 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
1885 Name of table policy is on
1890 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1891 <structfield>policyname
</structfield> <type>name
</type>
1892 (references
<link linkend=
"catalog-pg-policy"><structname>pg_policy
</structname></link>.
<structfield>polname
</structfield>)
1900 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1901 <structfield>permissive
</structfield> <type>text
</type>
1904 Is the policy permissive or restrictive?
1909 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1910 <structfield>roles
</structfield> <type>name[]
</type>
1913 The roles to which this policy applies
1918 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1919 <structfield>cmd
</structfield> <type>text
</type>
1922 The command type to which the policy is applied
1927 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1928 <structfield>qual
</structfield> <type>text
</type>
1931 The expression added to the security barrier qualifications for
1932 queries that this policy applies to
1937 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1938 <structfield>with_check
</structfield> <type>text
</type>
1941 The expression added to the WITH CHECK qualifications for
1942 queries that attempt to add rows to this table
1951 <sect1 id=
"view-pg-prepared-statements">
1952 <title><structname>pg_prepared_statements
</structname></title>
1954 <indexterm zone=
"view-pg-prepared-statements">
1955 <primary>pg_prepared_statements
</primary>
1959 The
<structname>pg_prepared_statements
</structname> view displays
1960 all the prepared statements that are available in the current
1961 session. See
<xref linkend=
"sql-prepare"/> for more information about prepared
1966 <structname>pg_prepared_statements
</structname> contains one row
1967 for each prepared statement. Rows are added to the view when a new
1968 prepared statement is created and removed when a prepared statement
1969 is released (for example, via the
<link linkend=
"sql-deallocate"><command>DEALLOCATE
</command></link> command).
1973 <title><structname>pg_prepared_statements
</structname> Columns
</title>
1977 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1988 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1989 <structfield>name
</structfield> <type>text
</type>
1992 The identifier of the prepared statement
1997 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1998 <structfield>statement
</structfield> <type>text
</type>
2001 The query string submitted by the client to create this
2002 prepared statement. For prepared statements created via SQL,
2003 this is the
<command>PREPARE
</command> statement submitted by
2004 the client. For prepared statements created via the
2005 frontend/backend protocol, this is the text of the prepared
2011 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2012 <structfield>prepare_time
</structfield> <type>timestamptz
</type>
2015 The time at which the prepared statement was created
2020 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2021 <structfield>parameter_types
</structfield> <type>regtype[]
</type>
2024 The expected parameter types for the prepared statement in the
2025 form of an array of
<type>regtype
</type>. The OID corresponding
2026 to an element of this array can be obtained by casting the
2027 <type>regtype
</type> value to
<type>oid
</type>.
2032 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2033 <structfield>result_types
</structfield> <type>regtype[]
</type>
2036 The types of the columns returned by the prepared statement in the
2037 form of an array of
<type>regtype
</type>. The OID corresponding
2038 to an element of this array can be obtained by casting the
2039 <type>regtype
</type> value to
<type>oid
</type>.
2040 If the prepared statement does not provide a result (e.g., a DML
2041 statement), then this field will be null.
2046 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2047 <structfield>from_sql
</structfield> <type>bool
</type>
2050 <literal>true
</literal> if the prepared statement was created
2051 via the
<command>PREPARE
</command> SQL command;
2052 <literal>false
</literal> if the statement was prepared via the
2053 frontend/backend protocol
2058 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2059 <structfield>generic_plans
</structfield> <type>int8
</type>
2062 Number of times generic plan was chosen
2067 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2068 <structfield>custom_plans
</structfield> <type>int8
</type>
2071 Number of times custom plan was chosen
2079 The
<structname>pg_prepared_statements
</structname> view is read-only.
2083 <sect1 id=
"view-pg-prepared-xacts">
2084 <title><structname>pg_prepared_xacts
</structname></title>
2086 <indexterm zone=
"view-pg-prepared-xacts">
2087 <primary>pg_prepared_xacts
</primary>
2091 The view
<structname>pg_prepared_xacts
</structname> displays
2092 information about transactions that are currently prepared for two-phase
2093 commit (see
<xref linkend=
"sql-prepare-transaction"/> for details).
2097 <structname>pg_prepared_xacts
</structname> contains one row per prepared
2098 transaction. An entry is removed when the transaction is committed or
2103 <title><structname>pg_prepared_xacts
</structname> Columns
</title>
2107 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2118 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2119 <structfield>transaction
</structfield> <type>xid
</type>
2122 Numeric transaction identifier of the prepared transaction
2127 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2128 <structfield>gid
</structfield> <type>text
</type>
2131 Global transaction identifier that was assigned to the transaction
2136 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2137 <structfield>prepared
</structfield> <type>timestamptz
</type>
2140 Time at which the transaction was prepared for commit
2145 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2146 <structfield>owner
</structfield> <type>name
</type>
2147 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
2150 Name of the user that executed the transaction
2155 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2156 <structfield>database
</structfield> <type>name
</type>
2157 (references
<link linkend=
"catalog-pg-database"><structname>pg_database
</structname></link>.
<structfield>datname
</structfield>)
2160 Name of the database in which the transaction was executed
2168 When the
<structname>pg_prepared_xacts
</structname> view is accessed, the
2169 internal transaction manager data structures are momentarily locked, and
2170 a copy is made for the view to display. This ensures that the
2171 view produces a consistent set of results, while not blocking
2172 normal operations longer than necessary. Nonetheless
2173 there could be some impact on database performance if this view is
2174 frequently accessed.
2179 <sect1 id=
"view-pg-publication-tables">
2180 <title><structname>pg_publication_tables
</structname></title>
2182 <indexterm zone=
"view-pg-publication-tables">
2183 <primary>pg_publication_tables
</primary>
2187 The view
<structname>pg_publication_tables
</structname> provides
2188 information about the mapping between publications and information of
2189 tables they contain. Unlike the underlying catalog
2190 <link linkend=
"catalog-pg-publication-rel"><structname>pg_publication_rel
</structname></link>,
2191 this view expands publications defined as
2192 <link linkend=
"sql-createpublication-params-for-all-tables"><literal>FOR ALL TABLES
</literal></link>
2193 and
<link linkend=
"sql-createpublication-params-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA
</literal></link>,
2194 so for such publications there will be a row for each eligible table.
2198 <title><structname>pg_publication_tables
</structname> Columns
</title>
2202 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2213 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2214 <structfield>pubname
</structfield> <type>name
</type>
2215 (references
<link linkend=
"catalog-pg-publication"><structname>pg_publication
</structname></link>.
<structfield>pubname
</structfield>)
2223 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2224 <structfield>schemaname
</structfield> <type>name
</type>
2225 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
2228 Name of schema containing table
2233 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2234 <structfield>tablename
</structfield> <type>name
</type>
2235 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
2243 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2244 <structfield>attnames
</structfield> <type>name[]
</type>
2245 (references
<link linkend=
"catalog-pg-attribute"><structname>pg_attribute
</structname></link>.
<structfield>attname
</structfield>)
2248 Names of table columns included in the publication. This contains all
2249 the columns of the table when the user didn't specify the column list
2255 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2256 <structfield>rowfilter
</structfield> <type>text
</type>
2259 Expression for the table's publication qualifying condition
2267 <sect1 id=
"view-pg-replication-origin-status">
2268 <title><structname>pg_replication_origin_status
</structname></title>
2270 <indexterm zone=
"view-pg-replication-origin-status">
2271 <primary>pg_replication_origin_status
</primary>
2275 The
<structname>pg_replication_origin_status
</structname> view
2276 contains information about how far replay for a certain origin has
2277 progressed. For more on replication origins
2278 see
<xref linkend=
"replication-origins"/>.
2282 <title><structname>pg_replication_origin_status
</structname> Columns
</title>
2286 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2297 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2298 <structfield>local_id
</structfield> <type>oid
</type>
2299 (references
<link linkend=
"catalog-pg-replication-origin"><structname>pg_replication_origin
</structname></link>.
<structfield>roident
</structfield>)
2302 internal node identifier
2307 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2308 <structfield>external_id
</structfield> <type>text
</type>
2309 (references
<link linkend=
"catalog-pg-replication-origin"><structname>pg_replication_origin
</structname></link>.
<structfield>roname
</structfield>)
2312 external node identifier
2317 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2318 <structfield>remote_lsn
</structfield> <type>pg_lsn
</type>
2321 The origin node's LSN up to which data has been replicated.
2326 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2327 <structfield>local_lsn
</structfield> <type>pg_lsn
</type>
2330 This node's LSN at which
<literal>remote_lsn
</literal> has
2331 been replicated. Used to flush commit records before persisting
2332 data to disk when using asynchronous commits.
2340 <sect1 id=
"view-pg-replication-slots">
2341 <title><structname>pg_replication_slots
</structname></title>
2343 <indexterm zone=
"view-pg-replication-slots">
2344 <primary>pg_replication_slots
</primary>
2348 The
<structname>pg_replication_slots
</structname> view provides a listing
2349 of all replication slots that currently exist on the database cluster,
2350 along with their current state.
2354 For more on replication slots,
2355 see
<xref linkend=
"streaming-replication-slots"/> and
<xref linkend=
"logicaldecoding"/>.
2359 <title><structname>pg_replication_slots
</structname> Columns
</title>
2363 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2374 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2375 <structfield>slot_name
</structfield> <type>name
</type>
2378 A unique, cluster-wide identifier for the replication slot
2383 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2384 <structfield>plugin
</structfield> <type>name
</type>
2387 The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.
2392 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2393 <structfield>slot_type
</structfield> <type>text
</type>
2396 The slot type:
<literal>physical
</literal> or
<literal>logical
</literal>
2401 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2402 <structfield>datoid
</structfield> <type>oid
</type>
2403 (references
<link linkend=
"catalog-pg-database"><structname>pg_database
</structname></link>.
<structfield>oid
</structfield>)
2406 The OID of the database this slot is associated with, or
2407 null. Only logical slots have an associated database.
2412 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2413 <structfield>database
</structfield> <type>name
</type>
2414 (references
<link linkend=
"catalog-pg-database"><structname>pg_database
</structname></link>.
<structfield>datname
</structfield>)
2417 The name of the database this slot is associated with, or
2418 null. Only logical slots have an associated database.
2423 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2424 <structfield>temporary
</structfield> <type>bool
</type>
2427 True if this is a temporary replication slot. Temporary slots are
2428 not saved to disk and are automatically dropped on error or when
2429 the session has finished.
2434 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2435 <structfield>active
</structfield> <type>bool
</type>
2438 True if this slot is currently being streamed
2443 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2444 <structfield>active_pid
</structfield> <type>int4
</type>
2447 The process ID of the session streaming data for this slot.
2448 <literal>NULL
</literal> if inactive.
2453 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2454 <structfield>xmin
</structfield> <type>xid
</type>
2457 The oldest transaction that this slot needs the database to
2458 retain.
<literal>VACUUM
</literal> cannot remove tuples deleted
2459 by any later transaction.
2464 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2465 <structfield>catalog_xmin
</structfield> <type>xid
</type>
2468 The oldest transaction affecting the system catalogs that this
2469 slot needs the database to retain.
<literal>VACUUM
</literal> cannot
2470 remove catalog tuples deleted by any later transaction.
2475 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2476 <structfield>restart_lsn
</structfield> <type>pg_lsn
</type>
2479 The address (
<literal>LSN
</literal>) of oldest WAL which still
2480 might be required by the consumer of this slot and thus won't be
2481 automatically removed during checkpoints unless this LSN
2482 gets behind more than
<xref linkend=
"guc-max-slot-wal-keep-size"/>
2483 from the current LSN.
<literal>NULL
</literal>
2484 if the
<literal>LSN
</literal> of this slot has never been reserved.
2489 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2490 <structfield>confirmed_flush_lsn
</structfield> <type>pg_lsn
</type>
2493 The address (
<literal>LSN
</literal>) up to which the logical
2494 slot's consumer has confirmed receiving data. Data corresponding to the
2495 transactions committed before this
<literal>LSN
</literal> is not
2496 available anymore.
<literal>NULL
</literal> for physical slots.
2501 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2502 <structfield>wal_status
</structfield> <type>text
</type>
2505 Availability of WAL files claimed by this slot.
2506 Possible values are:
2509 <para><literal>reserved
</literal> means that the claimed files
2510 are within
<varname>max_wal_size
</varname>.
</para>
2513 <para><literal>extended
</literal> means
2514 that
<varname>max_wal_size
</varname> is exceeded but the files are
2515 still retained, either by the replication slot or
2516 by
<varname>wal_keep_size
</varname>.
2521 <literal>unreserved
</literal> means that the slot no longer
2522 retains the required WAL files and some of them are to be removed at
2523 the next checkpoint. This state can return
2524 to
<literal>reserved
</literal> or
<literal>extended
</literal>.
2529 <literal>lost
</literal> means that some required WAL files have
2530 been removed and this slot is no longer usable.
2534 The last two states are seen only when
2535 <xref linkend=
"guc-max-slot-wal-keep-size"/> is
2536 non-negative. If
<structfield>restart_lsn
</structfield> is NULL, this
2542 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2543 <structfield>safe_wal_size
</structfield> <type>int8
</type>
2546 The number of bytes that can be written to WAL such that this slot
2547 is not in danger of getting in state
"lost". It is NULL for lost
2548 slots, as well as if
<varname>max_slot_wal_keep_size
</varname>
2549 is
<literal>-
1</literal>.
2554 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2555 <structfield>two_phase
</structfield> <type>bool
</type>
2558 True if the slot is enabled for decoding prepared transactions. Always
2559 false for physical slots.
2564 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2565 <structfield>inactive_since
</structfield> <type>timestamptz
</type>
2568 The time when the slot became inactive.
<literal>NULL
</literal> if the
2569 slot is currently being streamed.
2570 Note that for slots on the standby that are being synced from a
2571 primary server (whose
<structfield>synced
</structfield> field is
2572 <literal>true
</literal>), the
<structfield>inactive_since
</structfield>
2573 indicates the time when slot synchronization (see
<xref
2574 linkend=
"logicaldecoding-replication-slots-synchronization"/>)
2575 was most recently stopped.
<literal>NULL
</literal> if the slot
2576 has always been synchronized. On standby, this is useful for slots
2577 that are being synced from a primary server (whose
2578 <structfield>synced
</structfield> field is
<literal>true
</literal>)
2579 so they know when the slot stopped being synchronized.
2584 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2585 <structfield>conflicting
</structfield> <type>bool
</type>
2588 True if this logical slot conflicted with recovery (and so is now
2589 invalidated). When this column is true, check
2590 <structfield>invalidation_reason
</structfield> column for the conflict
2591 reason. Always
<literal>NULL
</literal> for physical slots.
2596 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2597 <structfield>invalidation_reason
</structfield> <type>text
</type>
2600 The reason for the slot's invalidation. It is set for both logical and
2601 physical slots.
<literal>NULL
</literal> if the slot is not invalidated.
2602 Possible values are:
2603 <itemizedlist spacing=
"compact">
2606 <literal>wal_removed
</literal> means that the required WAL has been
2612 <literal>rows_removed
</literal> means that the required rows have
2613 been removed. It is set only for logical slots.
2618 <literal>wal_level_insufficient
</literal> means that the
2619 primary doesn't have a
<xref linkend=
"guc-wal-level"/> sufficient to
2620 perform logical decoding. It is set only for logical slots.
2628 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2629 <structfield>failover
</structfield> <type>bool
</type>
2632 True if this is a logical slot enabled to be synced to the standbys
2633 so that logical replication can be resumed from the new primary
2634 after failover. Always false for physical slots.
2639 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2640 <structfield>synced
</structfield> <type>bool
</type>
2643 True if this is a logical slot that was synced from a primary server.
2644 On a hot standby, the slots with the synced column marked as true can
2645 neither be used for logical decoding nor dropped manually. The value
2646 of this column has no meaning on the primary server; the column value on
2647 the primary is default false for all slots but may (if leftover from a
2648 promoted standby) also be true.
2657 <sect1 id=
"view-pg-roles">
2658 <title><structname>pg_roles
</structname></title>
2660 <indexterm zone=
"view-pg-roles">
2661 <primary>pg_roles
</primary>
2665 The view
<structname>pg_roles
</structname> provides access to
2666 information about database roles. This is simply a publicly
2668 <link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>
2669 that blanks out the password field.
2673 <title><structname>pg_roles
</structname> Columns
</title>
2677 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2688 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2689 <structfield>rolname
</structfield> <type>name
</type>
2697 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2698 <structfield>rolsuper
</structfield> <type>bool
</type>
2701 Role has superuser privileges
2706 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2707 <structfield>rolinherit
</structfield> <type>bool
</type>
2710 Role automatically inherits privileges of roles it is a
2716 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2717 <structfield>rolcreaterole
</structfield> <type>bool
</type>
2720 Role can create more roles
2725 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2726 <structfield>rolcreatedb
</structfield> <type>bool
</type>
2729 Role can create databases
2734 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2735 <structfield>rolcanlogin
</structfield> <type>bool
</type>
2738 Role can log in. That is, this role can be given as the initial
2739 session authorization identifier
2744 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2745 <structfield>rolreplication
</structfield> <type>bool
</type>
2748 Role is a replication role. A replication role can initiate replication
2749 connections and create and drop replication slots.
2754 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2755 <structfield>rolconnlimit
</structfield> <type>int4
</type>
2758 For roles that can log in, this sets maximum number of concurrent
2759 connections this role can make. -
1 means no limit.
2764 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2765 <structfield>rolpassword
</structfield> <type>text
</type>
2768 Not the password (always reads as
<literal>********
</literal>)
2773 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2774 <structfield>rolvaliduntil
</structfield> <type>timestamptz
</type>
2777 Password expiry time (only used for password authentication);
2778 null if no expiration
2783 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2784 <structfield>rolbypassrls
</structfield> <type>bool
</type>
2787 Role bypasses every row-level security policy, see
2788 <xref linkend=
"ddl-rowsecurity"/> for more information.
2793 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2794 <structfield>rolconfig
</structfield> <type>text[]
</type>
2797 Role-specific defaults for run-time configuration variables
2802 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2803 <structfield>oid
</structfield> <type>oid
</type>
2804 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>oid
</structfield>)
2816 <sect1 id=
"view-pg-rules">
2817 <title><structname>pg_rules
</structname></title>
2819 <indexterm zone=
"view-pg-rules">
2820 <primary>pg_rules
</primary>
2824 The view
<structname>pg_rules
</structname> provides access to
2825 useful information about query rewrite rules.
2829 <title><structname>pg_rules
</structname> Columns
</title>
2833 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2844 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2845 <structfield>schemaname
</structfield> <type>name
</type>
2846 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
2849 Name of schema containing table
2854 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2855 <structfield>tablename
</structfield> <type>name
</type>
2856 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
2859 Name of table the rule is for
2864 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2865 <structfield>rulename
</structfield> <type>name
</type>
2866 (references
<link linkend=
"catalog-pg-rewrite"><structname>pg_rewrite
</structname></link>.
<structfield>rulename
</structfield>)
2874 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2875 <structfield>definition
</structfield> <type>text
</type>
2878 Rule definition (a reconstructed creation command)
2886 The
<structname>pg_rules
</structname> view excludes the
<literal>ON SELECT
</literal> rules
2887 of views and materialized views; those can be seen in
2888 <link linkend=
"view-pg-views"><structname>pg_views
</structname></link> and
<link linkend=
"view-pg-matviews"><structname>pg_matviews
</structname></link>.
2893 <sect1 id=
"view-pg-seclabels">
2894 <title><structname>pg_seclabels
</structname></title>
2896 <indexterm zone=
"view-pg-seclabels">
2897 <primary>pg_seclabels
</primary>
2901 The view
<structname>pg_seclabels
</structname> provides information about
2902 security labels. It as an easier-to-query version of the
2903 <link linkend=
"catalog-pg-seclabel"><structname>pg_seclabel
</structname></link> catalog.
2907 <title><structname>pg_seclabels
</structname> Columns
</title>
2911 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2922 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2923 <structfield>objoid
</structfield> <type>oid
</type>
2924 (references any OID column)
2927 The OID of the object this security label pertains to
2932 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2933 <structfield>classoid
</structfield> <type>oid
</type>
2934 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>oid
</structfield>)
2937 The OID of the system catalog this object appears in
2942 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2943 <structfield>objsubid
</structfield> <type>int4
</type>
2946 For a security label on a table column, this is the column number (the
2947 <structfield>objoid
</structfield> and
<structfield>classoid
</structfield> refer to
2948 the table itself). For all other object types, this column is
2954 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2955 <structfield>objtype
</structfield> <type>text
</type>
2958 The type of object to which this label applies, as text.
2963 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2964 <structfield>objnamespace
</structfield> <type>oid
</type>
2965 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>oid
</structfield>)
2968 The OID of the namespace for this object, if applicable;
2974 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2975 <structfield>objname
</structfield> <type>text
</type>
2978 The name of the object to which this label applies, as text.
2983 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2984 <structfield>provider
</structfield> <type>text
</type>
2985 (references
<link linkend=
"catalog-pg-seclabel"><structname>pg_seclabel
</structname></link>.
<structfield>provider
</structfield>)
2988 The label provider associated with this label.
2993 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2994 <structfield>label
</structfield> <type>text
</type>
2995 (references
<link linkend=
"catalog-pg-seclabel"><structname>pg_seclabel
</structname></link>.
<structfield>label
</structfield>)
2998 The security label applied to this object.
3006 <sect1 id=
"view-pg-sequences">
3007 <title><structname>pg_sequences
</structname></title>
3009 <indexterm zone=
"view-pg-sequences">
3010 <primary>pg_sequences
</primary>
3014 The view
<structname>pg_sequences
</structname> provides access to
3015 useful information about each sequence in the database.
3019 <title><structname>pg_sequences
</structname> Columns
</title>
3023 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3034 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3035 <structfield>schemaname
</structfield> <type>name
</type>
3036 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
3039 Name of schema containing sequence
3044 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3045 <structfield>sequencename
</structfield> <type>name
</type>
3046 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
3054 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3055 <structfield>sequenceowner
</structfield> <type>name
</type>
3056 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
3059 Name of sequence's owner
3064 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3065 <structfield>data_type
</structfield> <type>regtype
</type>
3066 (references
<link linkend=
"catalog-pg-type"><structname>pg_type
</structname></link>.
<structfield>oid
</structfield>)
3069 Data type of the sequence
3074 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3075 <structfield>start_value
</structfield> <type>int8
</type>
3078 Start value of the sequence
3083 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3084 <structfield>min_value
</structfield> <type>int8
</type>
3087 Minimum value of the sequence
3092 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3093 <structfield>max_value
</structfield> <type>int8
</type>
3096 Maximum value of the sequence
3101 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3102 <structfield>increment_by
</structfield> <type>int8
</type>
3105 Increment value of the sequence
3110 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3111 <structfield>cycle
</structfield> <type>bool
</type>
3114 Whether the sequence cycles
3119 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3120 <structfield>cache_size
</structfield> <type>int8
</type>
3123 Cache size of the sequence
3128 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3129 <structfield>last_value
</structfield> <type>int8
</type>
3132 The last sequence value written to disk. If caching is used,
3133 this value can be greater than the last value handed out from the
3142 The
<structfield>last_value
</structfield> column will read as null if any of
3143 the following are true:
3147 The sequence has not been read from yet.
3152 The current user does not have
<literal>USAGE
</literal> or
3153 <literal>SELECT
</literal> privilege on the sequence.
3158 The sequence is unlogged and the server is a standby.
3166 <sect1 id=
"view-pg-settings">
3167 <title><structname>pg_settings
</structname></title>
3169 <indexterm zone=
"view-pg-settings">
3170 <primary>pg_settings
</primary>
3174 The view
<structname>pg_settings
</structname> provides access to
3175 run-time parameters of the server. It is essentially an alternative
3176 interface to the
<link linkend=
"sql-show"><command>SHOW
</command></link>
3177 and
<link linkend=
"sql-set"><command>SET
</command></link> commands.
3178 It also provides access to some facts about each parameter that are
3179 not directly available from
<link linkend=
"sql-show"><command>SHOW
</command></link>, such as minimum and
3184 <title><structname>pg_settings
</structname> Columns
</title>
3188 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3199 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3200 <structfield>name
</structfield> <type>text
</type>
3203 Run-time configuration parameter name
3208 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3209 <structfield>setting
</structfield> <type>text
</type>
3212 Current value of the parameter
3217 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3218 <structfield>unit
</structfield> <type>text
</type>
3221 Implicit unit of the parameter
3226 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3227 <structfield>category
</structfield> <type>text
</type>
3230 Logical group of the parameter
3235 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3236 <structfield>short_desc
</structfield> <type>text
</type>
3239 A brief description of the parameter
3244 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3245 <structfield>extra_desc
</structfield> <type>text
</type>
3248 Additional, more detailed, description of the parameter
3253 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3254 <structfield>context
</structfield> <type>text
</type>
3257 Context required to set the parameter's value (see below)
3262 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3263 <structfield>vartype
</structfield> <type>text
</type>
3266 Parameter type (
<literal>bool
</literal>,
<literal>enum
</literal>,
3267 <literal>integer
</literal>,
<literal>real
</literal>, or
<literal>string
</literal>)
3272 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3273 <structfield>source
</structfield> <type>text
</type>
3276 Source of the current parameter value
3281 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3282 <structfield>min_val
</structfield> <type>text
</type>
3285 Minimum allowed value of the parameter (null for non-numeric
3291 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3292 <structfield>max_val
</structfield> <type>text
</type>
3295 Maximum allowed value of the parameter (null for non-numeric
3301 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3302 <structfield>enumvals
</structfield> <type>text[]
</type>
3305 Allowed values of an enum parameter (null for non-enum
3311 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3312 <structfield>boot_val
</structfield> <type>text
</type>
3315 Parameter value assumed at server startup if the parameter is
3321 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3322 <structfield>reset_val
</structfield> <type>text
</type>
3325 Value that
<link linkend=
"sql-reset"><command>RESET
</command></link> would reset the parameter to
3326 in the current session
3331 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3332 <structfield>sourcefile
</structfield> <type>text
</type>
3335 Configuration file the current value was set in (null for
3336 values set from sources other than configuration files, or when
3337 examined by a user who neither is a superuser nor has privileges of
3338 <literal>pg_read_all_settings
</literal>); helpful when using
3339 <literal>include
</literal> directives in configuration files
3344 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3345 <structfield>sourceline
</structfield> <type>int4
</type>
3348 Line number within the configuration file the current value was
3349 set at (null for values set from sources other than configuration files,
3350 or when examined by a user who neither is a superuser nor has privileges of
3351 <literal>pg_read_all_settings
</literal>).
3356 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3357 <structfield>pending_restart
</structfield> <type>bool
</type>
3360 <literal>true
</literal> if the value has been changed in the
3361 configuration file but needs a restart; or
<literal>false
</literal>
3370 There are several possible values of
<structfield>context
</structfield>.
3371 In order of decreasing difficulty of changing the setting, they are:
3376 <!-- PGC_INTERNAL -->
3377 <term><literal>internal
</literal></term>
3380 These settings cannot be changed directly; they reflect internally
3381 determined values. Some of them may be adjustable by rebuilding the
3382 server with different configuration options, or by changing options
3383 supplied to
<application>initdb
</application>.
3388 <!-- PGC_POSTMASTER -->
3389 <term><literal>postmaster
</literal></term>
3392 These settings can only be applied when the server starts, so any change
3393 requires restarting the server. Values for these settings are typically
3394 stored in the
<filename>postgresql.conf
</filename> file, or passed on
3395 the command line when starting the server. Of course, settings with any
3396 of the lower
<structfield>context
</structfield> types can also be
3397 set at server start time.
3403 <term><literal>sighup
</literal></term>
3406 Changes to these settings can be made in
3407 <filename>postgresql.conf
</filename> without restarting the server.
3408 Send a
<systemitem>SIGHUP
</systemitem> signal to the postmaster to
3409 cause it to re-read
<filename>postgresql.conf
</filename> and apply
3410 the changes. The postmaster will also forward the
3411 <systemitem>SIGHUP
</systemitem> signal to its child processes so that
3412 they all pick up the new value.
3417 <!-- PGC_SU_BACKEND -->
3418 <term><literal>superuser-backend
</literal></term>
3421 Changes to these settings can be made in
3422 <filename>postgresql.conf
</filename> without restarting the server.
3423 They can also be set for a particular session in the connection request
3424 packet (for example, via
<application>libpq
</application>'s
<literal>PGOPTIONS
</literal>
3425 environment variable), but only if the connecting user is a superuser
3426 or has been granted the appropriate
<literal>SET
</literal> privilege.
3427 However, these settings never change in a session after it is started.
3428 If you change them in
<filename>postgresql.conf
</filename>, send a
3429 <systemitem>SIGHUP
</systemitem> signal to the postmaster to cause it to
3430 re-read
<filename>postgresql.conf
</filename>. The new values will only
3431 affect subsequently-launched sessions.
3436 <!-- PGC_BACKEND -->
3437 <term><literal>backend
</literal></term>
3440 Changes to these settings can be made in
3441 <filename>postgresql.conf
</filename> without restarting the server.
3442 They can also be set for a particular session in the connection request
3443 packet (for example, via
<application>libpq
</application>'s
<literal>PGOPTIONS
</literal>
3444 environment variable); any user can make such a change for their session.
3445 However, these settings never change in a session after it is started.
3446 If you change them in
<filename>postgresql.conf
</filename>, send a
3447 <systemitem>SIGHUP
</systemitem> signal to the postmaster to cause it to
3448 re-read
<filename>postgresql.conf
</filename>. The new values will only
3449 affect subsequently-launched sessions.
3455 <term><literal>superuser
</literal></term>
3458 These settings can be set from
<filename>postgresql.conf
</filename>,
3459 or within a session via the
<command>SET
</command> command; but only superusers
3460 and users with the appropriate
<literal>SET
</literal> privilege
3461 can change them via
<command>SET
</command>. Changes in
3462 <filename>postgresql.conf
</filename> will affect existing sessions
3463 only if no session-local value has been established with
<command>SET
</command>.
3468 <!-- PGC_USERSET -->
3469 <term><literal>user
</literal></term>
3472 These settings can be set from
<filename>postgresql.conf
</filename>,
3473 or within a session via the
<command>SET
</command> command. Any user is
3474 allowed to change their session-local value. Changes in
3475 <filename>postgresql.conf
</filename> will affect existing sessions
3476 only if no session-local value has been established with
<command>SET
</command>.
3483 See
<xref linkend=
"config-setting"/> for more information about the various
3484 ways to change these parameters.
3488 This view cannot be inserted into or deleted from, but it can be updated. An
3489 <command>UPDATE
</command> applied to a row of
<structname>pg_settings
</structname>
3490 is equivalent to executing the
<command>SET
</command> command on that named
3491 parameter. The change only affects the value used by the current
3492 session. If an
<command>UPDATE
</command> is issued within a transaction
3493 that is later aborted, the effects of the
<command>UPDATE
</command> command
3494 disappear when the transaction is rolled back. Once the surrounding
3495 transaction is committed, the effects will persist until the end of the
3496 session, unless overridden by another
<command>UPDATE
</command> or
3497 <command>SET
</command>.
3502 display
<link linkend=
"runtime-config-custom">customized options
</link>
3503 unless the extension module that defines them has been loaded by the
3504 backend process executing the query (e.g., via a mention in
3505 <xref linkend=
"guc-shared-preload-libraries"/>,
3506 a call to a C function in the extension, or the
3507 <link linkend=
"sql-load"><command>LOAD
</command></link> command).
3508 For example, since
<link linkend=
"archive-modules">archive modules
</link>
3509 are normally loaded only by the archiver process not regular sessions,
3510 this view will not display any customized options defined by such modules
3511 unless special action is taken to load them into the backend process
3512 executing the query.
3517 <sect1 id=
"view-pg-shadow">
3518 <title><structname>pg_shadow
</structname></title>
3520 <indexterm zone=
"view-pg-shadow">
3521 <primary>pg_shadow
</primary>
3525 The view
<structname>pg_shadow
</structname> exists for backwards
3526 compatibility: it emulates a catalog that existed in
3527 <productname>PostgreSQL
</productname> before version
8.1.
3528 It shows properties of all roles that are marked as
3529 <structfield>rolcanlogin
</structfield> in
3530 <link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
3534 The name stems from the fact that this table
3535 should not be readable by the public since it contains passwords.
3536 <link linkend=
"view-pg-user"><structname>pg_user
</structname></link>
3537 is a publicly readable view on
3538 <structname>pg_shadow
</structname> that blanks out the password field.
3542 <title><structname>pg_shadow
</structname> Columns
</title>
3546 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3557 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3558 <structfield>usename
</structfield> <type>name
</type>
3559 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
3567 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3568 <structfield>usesysid
</structfield> <type>oid
</type>
3569 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>oid
</structfield>)
3577 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3578 <structfield>usecreatedb
</structfield> <type>bool
</type>
3581 User can create databases
3586 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3587 <structfield>usesuper
</structfield> <type>bool
</type>
3595 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3596 <structfield>userepl
</structfield> <type>bool
</type>
3599 User can initiate streaming replication and put the system in and
3605 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3606 <structfield>usebypassrls
</structfield> <type>bool
</type>
3609 User bypasses every row-level security policy, see
3610 <xref linkend=
"ddl-rowsecurity"/> for more information.
3615 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3616 <structfield>passwd
</structfield> <type>text
</type>
3619 Password (possibly encrypted); null if none. See
3620 <link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>
3621 for details of how encrypted passwords are stored.
3626 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3627 <structfield>valuntil
</structfield> <type>timestamptz
</type>
3630 Password expiry time (only used for password authentication)
3635 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3636 <structfield>useconfig
</structfield> <type>text[]
</type>
3639 Session defaults for run-time configuration variables
3648 <sect1 id=
"view-pg-shmem-allocations">
3649 <title><structname>pg_shmem_allocations
</structname></title>
3651 <indexterm zone=
"view-pg-shmem-allocations">
3652 <primary>pg_shmem_allocations
</primary>
3656 The
<structname>pg_shmem_allocations
</structname> view shows allocations
3657 made from the server's main shared memory segment. This includes both
3658 memory allocated by
<productname>PostgreSQL
</productname> itself and memory
3659 allocated by extensions using the mechanisms detailed in
3660 <xref linkend=
"xfunc-shared-addin" />.
3664 Note that this view does not include memory allocated using the dynamic
3665 shared memory infrastructure.
3669 <title><structname>pg_shmem_allocations
</structname> Columns
</title>
3673 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3684 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3685 <structfield>name
</structfield> <type>text
</type>
3688 The name of the shared memory allocation. NULL for unused memory
3689 and
<literal><anonymous
></literal> for anonymous
3695 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3696 <structfield>off
</structfield> <type>int8
</type>
3699 The offset at which the allocation starts. NULL for anonymous
3700 allocations, since details related to them are not known.
3705 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3706 <structfield>size
</structfield> <type>int8
</type>
3709 Size of the allocation in bytes
3714 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3715 <structfield>allocated_size
</structfield> <type>int8
</type>
3718 Size of the allocation in bytes including padding. For anonymous
3719 allocations, no information about padding is available, so the
3720 <literal>size
</literal> and
<literal>allocated_size
</literal> columns
3721 will always be equal. Padding is not meaningful for free memory, so
3722 the columns will be equal in that case also.
3730 Anonymous allocations are allocations that have been made
3731 with
<literal>ShmemAlloc()
</literal> directly, rather than via
3732 <literal>ShmemInitStruct()
</literal> or
3733 <literal>ShmemInitHash()
</literal>.
3737 By default, the
<structname>pg_shmem_allocations
</structname> view can be
3738 read only by superusers or roles with privileges of the
3739 <literal>pg_read_all_stats
</literal> role.
3743 <sect1 id=
"view-pg-stats">
3744 <title><structname>pg_stats
</structname></title>
3746 <indexterm zone=
"view-pg-stats">
3747 <primary>pg_stats
</primary>
3751 The view
<structname>pg_stats
</structname> provides access to
3752 the information stored in the
<link
3753 linkend=
"catalog-pg-statistic"><structname>pg_statistic
</structname></link>
3754 catalog. This view allows access only to rows of
3755 <link linkend=
"catalog-pg-statistic"><structname>pg_statistic
</structname></link> that correspond to tables the
3756 user has permission to read, and therefore it is safe to allow public
3757 read access to this view.
3761 <structname>pg_stats
</structname> is also designed to present the
3762 information in a more readable format than the underlying catalog
3763 — at the cost that its schema must be extended whenever new slot types
3764 are defined for
<link linkend=
"catalog-pg-statistic"><structname>pg_statistic
</structname></link>.
3768 <title><structname>pg_stats
</structname> Columns
</title>
3772 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3783 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3784 <structfield>schemaname
</structfield> <type>name
</type>
3785 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
3788 Name of schema containing table
3793 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3794 <structfield>tablename
</structfield> <type>name
</type>
3795 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
3803 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3804 <structfield>attname
</structfield> <type>name
</type>
3805 (references
<link linkend=
"catalog-pg-attribute"><structname>pg_attribute
</structname></link>.
<structfield>attname
</structfield>)
3808 Name of column described by this row
3813 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3814 <structfield>inherited
</structfield> <type>bool
</type>
3817 If true, this row includes values from child tables, not just the
3818 values in the specified table
3823 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3824 <structfield>null_frac
</structfield> <type>float4
</type>
3827 Fraction of column entries that are null
3832 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3833 <structfield>avg_width
</structfield> <type>int4
</type>
3836 Average width in bytes of column's entries
3841 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3842 <structfield>n_distinct
</structfield> <type>float4
</type>
3845 If greater than zero, the estimated number of distinct values in the
3846 column. If less than zero, the negative of the number of distinct
3847 values divided by the number of rows. (The negated form is used when
3848 <command>ANALYZE
</command> believes that the number of distinct values is
3849 likely to increase as the table grows; the positive form is used when
3850 the column seems to have a fixed number of possible values.) For
3851 example, -
1 indicates a unique column in which the number of distinct
3852 values is the same as the number of rows.
3857 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3858 <structfield>most_common_vals
</structfield> <type>anyarray
</type>
3861 A list of the most common values in the column. (Null if
3862 no values seem to be more common than any others.)
3867 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3868 <structfield>most_common_freqs
</structfield> <type>float4[]
</type>
3871 A list of the frequencies of the most common values,
3872 i.e., number of occurrences of each divided by total number of rows.
3873 (Null when
<structfield>most_common_vals
</structfield> is.)
3878 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3879 <structfield>histogram_bounds
</structfield> <type>anyarray
</type>
3882 A list of values that divide the column's values into groups of
3883 approximately equal population. The values in
3884 <structfield>most_common_vals
</structfield>, if present, are omitted from this
3885 histogram calculation. (This column is null if the column data type
3886 does not have a
<literal><</literal> operator or if the
3887 <structfield>most_common_vals
</structfield> list accounts for the entire
3893 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3894 <structfield>correlation
</structfield> <type>float4
</type>
3897 Statistical correlation between physical row ordering and
3898 logical ordering of the column values. This ranges from -
1 to +
1.
3899 When the value is near -
1 or +
1, an index scan on the column will
3900 be estimated to be cheaper than when it is near zero, due to reduction
3901 of random access to the disk. (This column is null if the column data
3902 type does not have a
<literal><</literal> operator.)
3907 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3908 <structfield>most_common_elems
</structfield> <type>anyarray
</type>
3911 A list of non-null element values most often appearing within values of
3912 the column. (Null for scalar types.)
3917 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3918 <structfield>most_common_elem_freqs
</structfield> <type>float4[]
</type>
3921 A list of the frequencies of the most common element values, i.e., the
3922 fraction of rows containing at least one instance of the given value.
3923 Two or three additional values follow the per-element frequencies;
3924 these are the minimum and maximum of the preceding per-element
3925 frequencies, and optionally the frequency of null elements.
3926 (Null when
<structfield>most_common_elems
</structfield> is.)
3931 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3932 <structfield>elem_count_histogram
</structfield> <type>float4[]
</type>
3935 A histogram of the counts of distinct non-null element values within the
3936 values of the column, followed by the average number of distinct
3937 non-null elements. (Null for scalar types.)
3942 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3943 <structfield>range_length_histogram
</structfield> <type>anyarray
</type>
3946 A histogram of the lengths of non-empty and non-null range values of a
3947 range type column. (Null for non-range types.)
3950 This histogram is calculated using the
<function>subtype_diff
</function>
3951 range function regardless of whether range bounds are inclusive.
3956 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3957 <structfield>range_empty_frac
</structfield> <type>float4
</type>
3960 Fraction of column entries whose values are empty ranges.
3961 (Null for non-range types.)
3966 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3967 <structfield>range_bounds_histogram
</structfield> <type>anyarray
</type>
3970 A histogram of lower and upper bounds of non-empty and non-null range
3971 values. (Null for non-range types.)
3974 These two histograms are represented as a single array of ranges, whose
3975 lower bounds represent the histogram of lower bounds, and upper bounds
3976 represent the histogram of upper bounds.
3984 The maximum number of entries in the array fields can be controlled on a
3985 column-by-column basis using the
<link linkend=
"sql-altertable"><command>ALTER
3986 TABLE SET STATISTICS
</command></link>
3987 command, or globally by setting the
3988 <xref linkend=
"guc-default-statistics-target"/> run-time parameter.
3993 <sect1 id=
"view-pg-stats-ext">
3994 <title><structname>pg_stats_ext
</structname></title>
3996 <indexterm zone=
"view-pg-stats-ext">
3997 <primary>pg_stats_ext
</primary>
4001 The view
<structname>pg_stats_ext
</structname> provides access to
4002 information about each extended statistics object in the database,
4003 combining information stored in the
<link
4004 linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link>
4005 and
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>
4006 catalogs. This view allows access only to rows of
4007 <link linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link> and
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>
4008 that correspond to tables the user owns, and therefore
4009 it is safe to allow public read access to this view.
4013 <structname>pg_stats_ext
</structname> is also designed to present the
4014 information in a more readable format than the underlying catalogs
4015 — at the cost that its schema must be extended whenever new types
4016 of extended statistics are added to
<link linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link>.
4020 <title><structname>pg_stats_ext
</structname> Columns
</title>
4024 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4035 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4036 <structfield>schemaname
</structfield> <type>name
</type>
4037 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4040 Name of schema containing table
4045 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4046 <structfield>tablename
</structfield> <type>name
</type>
4047 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
4055 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4056 <structfield>statistics_schemaname
</structfield> <type>name
</type>
4057 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4060 Name of schema containing extended statistics object
4065 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4066 <structfield>statistics_name
</structfield> <type>name
</type>
4067 (references
<link linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link>.
<structfield>stxname
</structfield>)
4070 Name of extended statistics object
4075 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4076 <structfield>statistics_owner
</structfield> <type>name
</type>
4077 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
4080 Owner of the extended statistics object
4085 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4086 <structfield>attnames
</structfield> <type>name[]
</type>
4087 (references
<link linkend=
"catalog-pg-attribute"><structname>pg_attribute
</structname></link>.
<structfield>attname
</structfield>)
4090 Names of the columns included in the extended statistics object
4095 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4096 <structfield>exprs
</structfield> <type>text[]
</type>
4099 Expressions included in the extended statistics object
4104 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4105 <structfield>kinds
</structfield> <type>char[]
</type>
4108 Types of extended statistics object enabled for this record
4113 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4114 <structfield>inherited
</structfield> <type>bool
</type>
4115 (references
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>.
<structfield>stxdinherit
</structfield>)
4118 If true, the stats include values from child tables, not just the
4119 values in the specified relation
4124 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4125 <structfield>n_distinct
</structfield> <type>pg_ndistinct
</type>
4128 N-distinct counts for combinations of column values. If greater
4129 than zero, the estimated number of distinct values in the combination.
4130 If less than zero, the negative of the number of distinct values divided
4131 by the number of rows.
4132 (The negated form is used when
<command>ANALYZE
</command> believes that
4133 the number of distinct values is likely to increase as the table grows;
4134 the positive form is used when the column seems to have a fixed number
4135 of possible values.) For example, -
1 indicates a unique combination of
4136 columns in which the number of distinct combinations is the same as the
4142 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4143 <structfield>dependencies
</structfield> <type>pg_dependencies
</type>
4146 Functional dependency statistics
4151 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4152 <structfield>most_common_vals
</structfield> <type>text[]
</type>
4155 A list of the most common combinations of values in the columns.
4156 (Null if no combinations seem to be more common than any others.)
4161 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4162 <structfield>most_common_val_nulls
</structfield> <type>bool[]
</type>
4165 A list of NULL flags for the most common combinations of values.
4166 (Null when
<structfield>most_common_vals
</structfield> is.)
4171 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4172 <structfield>most_common_freqs
</structfield> <type>float8[]
</type>
4175 A list of the frequencies of the most common combinations,
4176 i.e., number of occurrences of each divided by total number of rows.
4177 (Null when
<structfield>most_common_vals
</structfield> is.)
4182 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4183 <structfield>most_common_base_freqs
</structfield> <type>float8[]
</type>
4186 A list of the base frequencies of the most common combinations,
4187 i.e., product of per-value frequencies.
4188 (Null when
<structfield>most_common_vals
</structfield> is.)
4196 The maximum number of entries in the array fields can be controlled on a
4197 column-by-column basis using the
<link linkend=
"sql-altertable"><command>ALTER
4198 TABLE SET STATISTICS
</command></link> command, or globally by setting the
4199 <xref linkend=
"guc-default-statistics-target"/> run-time parameter.
4204 <sect1 id=
"view-pg-stats-ext-exprs">
4205 <title><structname>pg_stats_ext_exprs
</structname></title>
4207 <indexterm zone=
"view-pg-stats-ext-exprs">
4208 <primary>pg_stats_ext_exprs
</primary>
4212 The view
<structname>pg_stats_ext_exprs
</structname> provides access to
4213 information about all expressions included in extended statistics objects,
4214 combining information stored in the
<link
4215 linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link>
4216 and
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>
4217 catalogs. This view allows access only to rows of
4218 <link linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link> and
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>
4219 that correspond to tables the user owns, and therefore
4220 it is safe to allow public read access to this view.
4224 <structname>pg_stats_ext_exprs
</structname> is also designed to present
4225 the information in a more readable format than the underlying catalogs
4226 — at the cost that its schema must be extended whenever the structure
4227 of statistics in
<structname>pg_statistic_ext
</structname> changes.
4231 <title><structname>pg_stats_ext_exprs
</structname> Columns
</title>
4235 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4246 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4247 <structfield>schemaname
</structfield> <type>name
</type>
4248 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4251 Name of schema containing table
4256 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4257 <structfield>tablename
</structfield> <type>name
</type>
4258 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
4261 Name of table the statistics object is defined on
4266 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4267 <structfield>statistics_schemaname
</structfield> <type>name
</type>
4268 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4271 Name of schema containing extended statistics object
4276 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4277 <structfield>statistics_name
</structfield> <type>name
</type>
4278 (references
<link linkend=
"catalog-pg-statistic-ext"><structname>pg_statistic_ext
</structname></link>.
<structfield>stxname
</structfield>)
4281 Name of extended statistics object
4286 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4287 <structfield>statistics_owner
</structfield> <type>name
</type>
4288 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
4291 Owner of the extended statistics object
4296 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4297 <structfield>expr
</structfield> <type>text
</type>
4300 Expression included in the extended statistics object
4305 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4306 <structfield>inherited
</structfield> <type>bool
</type>
4307 (references
<link linkend=
"catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data
</structname></link>.
<structfield>stxdinherit
</structfield>)
4310 If true, the stats include values from child tables, not just the
4311 values in the specified relation
4316 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4317 <structfield>null_frac
</structfield> <type>float4
</type>
4320 Fraction of expression entries that are null
4325 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4326 <structfield>avg_width
</structfield> <type>int4
</type>
4329 Average width in bytes of expression's entries
4334 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4335 <structfield>n_distinct
</structfield> <type>float4
</type>
4338 If greater than zero, the estimated number of distinct values in the
4339 expression. If less than zero, the negative of the number of distinct
4340 values divided by the number of rows. (The negated form is used when
4341 <command>ANALYZE
</command> believes that the number of distinct values is
4342 likely to increase as the table grows; the positive form is used when
4343 the expression seems to have a fixed number of possible values.) For
4344 example, -
1 indicates a unique expression in which the number of distinct
4345 values is the same as the number of rows.
4350 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4351 <structfield>most_common_vals
</structfield> <type>anyarray
</type>
4354 A list of the most common values in the expression. (Null if
4355 no values seem to be more common than any others.)
4360 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4361 <structfield>most_common_freqs
</structfield> <type>float4[]
</type>
4364 A list of the frequencies of the most common values,
4365 i.e., number of occurrences of each divided by total number of rows.
4366 (Null when
<structfield>most_common_vals
</structfield> is.)
4371 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4372 <structfield>histogram_bounds
</structfield> <type>anyarray
</type>
4375 A list of values that divide the expression's values into groups of
4376 approximately equal population. The values in
4377 <structfield>most_common_vals
</structfield>, if present, are omitted from this
4378 histogram calculation. (This expression is null if the expression data type
4379 does not have a
<literal><</literal> operator or if the
4380 <structfield>most_common_vals
</structfield> list accounts for the entire
4386 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4387 <structfield>correlation
</structfield> <type>float4
</type>
4390 Statistical correlation between physical row ordering and
4391 logical ordering of the expression values. This ranges from -
1 to +
1.
4392 When the value is near -
1 or +
1, an index scan on the expression will
4393 be estimated to be cheaper than when it is near zero, due to reduction
4394 of random access to the disk. (This expression is null if the expression's
4395 data type does not have a
<literal><</literal> operator.)
4400 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4401 <structfield>most_common_elems
</structfield> <type>anyarray
</type>
4404 A list of non-null element values most often appearing within values of
4405 the expression. (Null for scalar types.)
4410 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4411 <structfield>most_common_elem_freqs
</structfield> <type>float4[]
</type>
4414 A list of the frequencies of the most common element values, i.e., the
4415 fraction of rows containing at least one instance of the given value.
4416 Two or three additional values follow the per-element frequencies;
4417 these are the minimum and maximum of the preceding per-element
4418 frequencies, and optionally the frequency of null elements.
4419 (Null when
<structfield>most_common_elems
</structfield> is.)
4424 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4425 <structfield>elem_count_histogram
</structfield> <type>float4[]
</type>
4428 A histogram of the counts of distinct non-null element values within the
4429 values of the expression, followed by the average number of distinct
4430 non-null elements. (Null for scalar types.)
4438 The maximum number of entries in the array fields can be controlled on a
4439 column-by-column basis using the
<link linkend=
"sql-altertable"><command>ALTER
4440 TABLE SET STATISTICS
</command></link> command, or globally by setting the
4441 <xref linkend=
"guc-default-statistics-target"/> run-time parameter.
4446 <sect1 id=
"view-pg-tables">
4447 <title><structname>pg_tables
</structname></title>
4449 <indexterm zone=
"view-pg-tables">
4450 <primary>pg_tables
</primary>
4454 The view
<structname>pg_tables
</structname> provides access to
4455 useful information about each table in the database.
4459 <title><structname>pg_tables
</structname> Columns
</title>
4463 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4474 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4475 <structfield>schemaname
</structfield> <type>name
</type>
4476 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4479 Name of schema containing table
4484 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4485 <structfield>tablename
</structfield> <type>name
</type>
4486 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
4494 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4495 <structfield>tableowner
</structfield> <type>name
</type>
4496 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
4499 Name of table's owner
4504 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4505 <structfield>tablespace
</structfield> <type>name
</type>
4506 (references
<link linkend=
"catalog-pg-tablespace"><structname>pg_tablespace
</structname></link>.
<structfield>spcname
</structfield>)
4509 Name of tablespace containing table (null if default for database)
4514 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4515 <structfield>hasindexes
</structfield> <type>bool
</type>
4516 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relhasindex
</structfield>)
4519 True if table has (or recently had) any indexes
4524 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4525 <structfield>hasrules
</structfield> <type>bool
</type>
4526 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relhasrules
</structfield>)
4529 True if table has (or once had) rules
4534 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4535 <structfield>hastriggers
</structfield> <type>bool
</type>
4536 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relhastriggers
</structfield>)
4539 True if table has (or once had) triggers
4544 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4545 <structfield>rowsecurity
</structfield> <type>bool
</type>
4546 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relrowsecurity
</structfield>)
4549 True if row security is enabled on the table
4558 <sect1 id=
"view-pg-timezone-abbrevs">
4559 <title><structname>pg_timezone_abbrevs
</structname></title>
4561 <indexterm zone=
"view-pg-timezone-abbrevs">
4562 <primary>pg_timezone_abbrevs
</primary>
4566 The view
<structname>pg_timezone_abbrevs
</structname> provides a list
4567 of time zone abbreviations that are currently recognized by the datetime
4568 input routines. The contents of this view change when the
4569 <xref linkend=
"guc-timezone"/> or
4570 <xref linkend=
"guc-timezone-abbreviations"/> run-time parameters are
4575 <title><structname>pg_timezone_abbrevs
</structname> Columns
</title>
4579 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4590 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4591 <structfield>abbrev
</structfield> <type>text
</type>
4594 Time zone abbreviation
4599 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4600 <structfield>utc_offset
</structfield> <type>interval
</type>
4603 Offset from UTC (positive means east of Greenwich)
4608 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4609 <structfield>is_dst
</structfield> <type>bool
</type>
4612 True if this is a daylight-savings abbreviation
4620 While most timezone abbreviations represent fixed offsets from UTC,
4621 there are some that have historically varied in value
4622 (see
<xref linkend=
"datetime-config-files"/> for more information).
4623 In such cases this view presents their current meaning.
4628 <sect1 id=
"view-pg-timezone-names">
4629 <title><structname>pg_timezone_names
</structname></title>
4631 <indexterm zone=
"view-pg-timezone-names">
4632 <primary>pg_timezone_names
</primary>
4636 The view
<structname>pg_timezone_names
</structname> provides a list
4637 of time zone names that are recognized by
<command>SET TIMEZONE
</command>,
4638 along with their associated abbreviations, UTC offsets,
4639 and daylight-savings status. (Technically,
4640 <productname>PostgreSQL
</productname> does not use UTC because leap
4641 seconds are not handled.)
4642 Unlike the abbreviations shown in
<link
4643 linkend=
"view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs
</structname></link>, many of these names imply a set of daylight-savings transition
4644 date rules. Therefore, the associated information changes across local DST
4645 boundaries. The displayed information is computed based on the current
4646 value of
<function>CURRENT_TIMESTAMP
</function>.
4650 <title><structname>pg_timezone_names
</structname> Columns
</title>
4654 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4665 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4666 <structfield>name
</structfield> <type>text
</type>
4674 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4675 <structfield>abbrev
</structfield> <type>text
</type>
4678 Time zone abbreviation
4683 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4684 <structfield>utc_offset
</structfield> <type>interval
</type>
4687 Offset from UTC (positive means east of Greenwich)
4692 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4693 <structfield>is_dst
</structfield> <type>bool
</type>
4696 True if currently observing daylight savings
4705 <sect1 id=
"view-pg-user">
4706 <title><structname>pg_user
</structname></title>
4708 <indexterm zone=
"view-pg-user">
4709 <primary>pg_user
</primary>
4713 The view
<structname>pg_user
</structname> provides access to
4714 information about database users. This is simply a publicly
4716 <link linkend=
"view-pg-shadow"><structname>pg_shadow
</structname></link>
4717 that blanks out the password field.
4721 <title><structname>pg_user
</structname> Columns
</title>
4725 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4736 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4737 <structfield>usename
</structfield> <type>name
</type>
4745 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4746 <structfield>usesysid
</structfield> <type>oid
</type>
4754 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4755 <structfield>usecreatedb
</structfield> <type>bool
</type>
4758 User can create databases
4763 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4764 <structfield>usesuper
</structfield> <type>bool
</type>
4772 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4773 <structfield>userepl
</structfield> <type>bool
</type>
4776 User can initiate streaming replication and put the system in and
4782 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4783 <structfield>usebypassrls
</structfield> <type>bool
</type>
4786 User bypasses every row-level security policy, see
4787 <xref linkend=
"ddl-rowsecurity"/> for more information.
4792 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4793 <structfield>passwd
</structfield> <type>text
</type>
4796 Not the password (always reads as
<literal>********
</literal>)
4801 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4802 <structfield>valuntil
</structfield> <type>timestamptz
</type>
4805 Password expiry time (only used for password authentication)
4810 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4811 <structfield>useconfig
</structfield> <type>text[]
</type>
4814 Session defaults for run-time configuration variables
4823 <sect1 id=
"view-pg-user-mappings">
4824 <title><structname>pg_user_mappings
</structname></title>
4826 <indexterm zone=
"view-pg-user-mappings">
4827 <primary>pg_user_mappings
</primary>
4831 The view
<structname>pg_user_mappings
</structname> provides access
4832 to information about user mappings. This is essentially a publicly
4834 <link linkend=
"catalog-pg-user-mapping"><structname>pg_user_mapping
</structname></link>
4835 that leaves out the options field if the user has no rights to use
4840 <title><structname>pg_user_mappings
</structname> Columns
</title>
4844 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4855 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4856 <structfield>umid
</structfield> <type>oid
</type>
4857 (references
<link linkend=
"catalog-pg-user-mapping"><structname>pg_user_mapping
</structname></link>.
<structfield>oid
</structfield>)
4860 OID of the user mapping
4865 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4866 <structfield>srvid
</structfield> <type>oid
</type>
4867 (references
<link linkend=
"catalog-pg-foreign-server"><structname>pg_foreign_server
</structname></link>.
<structfield>oid
</structfield>)
4870 The OID of the foreign server that contains this mapping
4875 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4876 <structfield>srvname
</structfield> <type>name
</type>
4877 (references
<link linkend=
"catalog-pg-foreign-server"><structname>pg_foreign_server
</structname></link>.
<structfield>srvname
</structfield>)
4880 Name of the foreign server
4885 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4886 <structfield>umuser
</structfield> <type>oid
</type>
4887 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>oid
</structfield>)
4890 OID of the local role being mapped, or zero if the user mapping is public
4895 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4896 <structfield>usename
</structfield> <type>name
</type>
4899 Name of the local user to be mapped
4904 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4905 <structfield>umoptions
</structfield> <type>text[]
</type>
4908 User mapping specific options, as
<quote>keyword=value
</quote> strings
4916 To protect password information stored as a user mapping option,
4917 the
<structfield>umoptions
</structfield> column will read as null
4918 unless one of the following applies:
4922 current user is the user being mapped, and owns the server or
4923 holds
<literal>USAGE
</literal> privilege on it
4928 current user is the server owner and mapping is for
<literal>PUBLIC
</literal>
4933 current user is a superuser
4942 <sect1 id=
"view-pg-views">
4943 <title><structname>pg_views
</structname></title>
4945 <indexterm zone=
"view-pg-views">
4946 <primary>pg_views
</primary>
4950 The view
<structname>pg_views
</structname> provides access to
4951 useful information about each view in the database.
4955 <title><structname>pg_views
</structname> Columns
</title>
4959 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4970 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4971 <structfield>schemaname
</structfield> <type>name
</type>
4972 (references
<link linkend=
"catalog-pg-namespace"><structname>pg_namespace
</structname></link>.
<structfield>nspname
</structfield>)
4975 Name of schema containing view
4980 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4981 <structfield>viewname
</structfield> <type>name
</type>
4982 (references
<link linkend=
"catalog-pg-class"><structname>pg_class
</structname></link>.
<structfield>relname
</structfield>)
4990 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4991 <structfield>viewowner
</structfield> <type>name
</type>
4992 (references
<link linkend=
"catalog-pg-authid"><structname>pg_authid
</structname></link>.
<structfield>rolname
</structfield>)
4995 Name of view's owner
5000 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5001 <structfield>definition
</structfield> <type>text
</type>
5004 View definition (a reconstructed
<xref linkend=
"sql-select"/> query)
5013 <sect1 id=
"view-pg-wait-events">
5014 <title><structname>pg_wait_events
</structname></title>
5016 <indexterm zone=
"view-pg-wait-events">
5017 <primary>pg_wait_events
</primary>
5021 The view
<structname>pg_wait_events
</structname> provides description about the
5026 <title><structname>pg_wait_events
</structname> Columns
</title>
5030 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5041 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5042 <structfield>type
</structfield> <type>text
</type>
5050 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5051 <structfield>name
</structfield> <type>text
</type>
5059 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5060 <structfield>description
</structfield> <type>text
</type>
5063 Wait event description