↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

Definitions for PostgreSQL 18

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

144 / 144 recorded definitionsA filled square means the entry is documented in that version. Select one to read it there.
  • pg_aggregatecatalog7.4 – 20

    The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions.

  • pg_aiosview18 – 20

    The pg_aios view lists all Asynchronous I/O handles that are currently in-use. An I/O handle is used to reference an I/O operation that is being prepared, executed or is in the process of completing. pg_aios contains one row for each I/O handle. This view is mainly useful for developers of PostgreSQL, but may also be useful when tuning PostgreSQL.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_amcatalog7.4 – 20

    The catalog pg_am stores information about relation access methods. There is one row for each access method supported by the system. Currently, only tables and indexes have access methods. The requirements for table and index access methods are discussed in detail in Chapter 62 and Chapter 63 respectively.

  • pg_amopcatalog7.4 – 20

    The catalog pg_amop stores information about operators associated with access method operator families. There is one row for each operator that is a member of an operator family. A family member can be either a search operator or an ordering operator. An operator can appear in more than one family, but cannot appear in more than one search position nor more than one ordering position within a family. (It is allowed, though unlikely, for an operator to be used for both search and ordering purposes.)

  • pg_amproccatalog7.4 – 20

    The catalog pg_amproc stores information about support functions associated with access method operator families. There is one row for each support function belonging to an operator family.

  • pg_attrdefcatalog7.4 – 20

    The catalog pg_attrdef stores column default expressions and generation expressions. The main information about columns is stored in pg_attribute. Only columns for which a default expression or generation expression has been explicitly set will have an entry here.

  • pg_attributecatalog7.4 – 20

    The catalog pg_attribute stores information about table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for indexes, and indeed all objects that have pg_class entries.) The term attribute is equivalent to column and is used for historical reasons.

  • pg_auth_memberscatalog8.1 – 20

    The catalog pg_auth_members shows the membership relations between roles. Any non-circular set of relationships is allowed. Because user identities are cluster-wide, pg_auth_members is shared across all databases of a cluster: there is only one copy of pg_auth_members per cluster, not one per database.

  • pg_authidcatalog8.1 – 20

    The catalog pg_authid contains information about database authorization identifiers (roles). A role subsumes the concepts of “users” and “groups”. A user is essentially just a role with the rolcanlogin flag set. Any role (with or without rolcanlogin) can have other roles as members; see pg_auth_members. Since this catalog contains passwords, it must not be publicly readable. pg_roles is a publicly readable view on pg_authid that blanks out the password field. Chapter 21 contains detailed information about user and privilege management. Because user identities are cluster-wide, pg_authid is shared across all databases of a cluster: there is only one copy of pg_authid per cluster, not one per database.

  • The pg_available_extension_versions view lists the specific extension versions that are available for installation. See also the pg_extension catalog, which shows the extensions currently installed.

  • The pg_available_extensions view lists the extensions that are available for installation. See also the pg_extension catalog, which shows the extensions currently installed.

  • The view pg_backend_memory_contexts displays all the memory contexts of the server process attached to the current session. pg_backend_memory_contexts contains one row for each memory context.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_castcatalog7.4 – 20

    The catalog pg_cast stores data type conversion paths, both built-in and user-defined. It should be noted that pg_cast does not represent every type conversion that the system knows how to perform; only those that cannot be deduced from some generic rule. For example, casting between a domain and its base type is not explicitly represented in pg_cast. Another important exception is that “automatic I/O conversion casts”, those performed using a data type's own I/O functions to convert to or from text or other string types, are not explicitly represented in pg_cast.

  • pg_classcatalog7.4 – 20

    The catalog pg_class describes tables and other objects that have columns or are otherwise similar to a table. This includes indexes (but see also pg_index), sequences (but see also pg_sequence), views, materialized views, composite types, and TOAST tables; see relkind. Below, when we mean all of these kinds of objects we speak of “relations”. Not all of pg_class's columns are meaningful for all relation kinds.

  • pg_collationcatalog9.1 – 20

    The catalog pg_collation describes the available collations, which are essentially mappings from an SQL name to operating system locale categories. See Section 23.2 for more information.

  • pg_configview9.6 – 20

    The view pg_config describes the compile-time configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries. It provides the same basic information as the pg_config PostgreSQL client application. By default, the pg_config view can be read only by superusers.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_constraintcatalog7.4 – 20

    The catalog pg_constraint stores check, not-null, primary key, unique, foreign key, and exclusion constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) User-defined constraint triggers (created with CREATE CONSTRAINT TRIGGER) also give rise to an entry in this table. Check constraints on domains are stored here, too.

  • pg_conversioncatalog7.4 – 20

    The catalog pg_conversion describes encoding conversion functions. See CREATE CONVERSION for more information.

  • pg_cursorsview8.2 – 20

    The pg_cursors view lists the cursors that are currently available. Cursors can be defined in several ways: via the DECLARE statement in SQL via the Bind message in the frontend/backend protocol, as described in Section 54.2.3 via the Server Programming Interface (SPI), as described in Section 45.1 The pg_cursors view displays cursors created by any of these means. Cursors only exist for the duration of the transaction that defines them, unless they have been declared WITH HOLD. Therefore non-holdable cursors are only present in the view until the end of their creating transaction.

  • pg_databasecatalog7.4 – 20

    The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Consult Chapter 22 for details about the meaning of some of the parameters. Unlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database.

  • pg_db_role_settingcatalog9.0 – 20

    The catalog pg_db_role_setting records the default values that have been set for run-time configuration variables, for each role and database combination. Unlike most system catalogs, pg_db_role_setting is shared across all databases of a cluster: there is only one copy of pg_db_role_setting per cluster, not one per database.

  • pg_default_aclcatalog9.0 – 20

    The catalog pg_default_acl stores initial privileges to be assigned to newly created objects.

  • pg_dependcatalog7.4 – 20

    The catalog pg_depend records the dependency relationships between database objects. This information allows DROP commands to find which other objects must be dropped by DROP CASCADE or prevent dropping in the DROP RESTRICT case. See also pg_shdepend, which performs a similar function for dependencies involving objects that are shared across a database cluster.

  • pg_descriptioncatalog7.4 – 20

    The catalog pg_description stores optional descriptions (comments) for each database object. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. Descriptions of many built-in system objects are provided in the initial contents of pg_description. See also pg_shdescription, which performs a similar function for descriptions involving objects that are shared across a database cluster.

  • pg_enumcatalog8.3 – 20

    The pg_enum catalog contains entries showing the values and labels for each enum type. The internal representation of a given enum value is actually the OID of its associated row in pg_enum.

  • pg_event_triggercatalog9.3 – 20

    The catalog pg_event_trigger stores event triggers. See Chapter 38 for more information.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_extensioncatalog9.1 – 20

    The catalog pg_extension stores information about the installed extensions. See Section 36.17 for details about extensions.

  • pg_file_settingsview9.5 – 20

    The view pg_file_settings provides a summary of the contents of the server's configuration file(s). A row appears in this view for each “name = value” entry appearing in the files, with annotations indicating whether the value could be applied successfully. Additional row(s) may appear for problems not linked to a “name = value” entry, such as syntax errors in the files. This view is helpful for checking whether planned changes in the configuration files will work, or for diagnosing a previous failure. Note that this view reports on the current contents of the files, not on what was last applied by the server. (The pg_settings view is usually sufficient to determine that.) By default, the pg_file_settings view can be read only by superusers.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_foreign_data_wrappercatalog8.4 – 20

    The catalog pg_foreign_data_wrapper stores foreign-data wrapper definitions. A foreign-data wrapper is the mechanism by which external data, residing on foreign servers, is accessed.

  • pg_foreign_servercatalog8.4 – 20

    The catalog pg_foreign_server stores foreign server definitions. A foreign server describes a source of external data, such as a remote server. Foreign servers are accessed via foreign-data wrappers.

  • pg_foreign_tablecatalog9.1 – 20

    The catalog pg_foreign_table contains auxiliary information about foreign tables. A foreign table is primarily represented by a pg_class entry, just like a regular table. Its pg_foreign_table entry contains the information that is pertinent only to foreign tables and not any other kind of relation.

  • pg_groupview7.4 – 20

    The view pg_group exists for backwards compatibility: it emulates a catalog that existed in PostgreSQL before version 8.1. It shows the names and members of all roles that are marked as not rolcanlogin, which is an approximation to the set of roles that are being used as groups.

  • pg_hba_file_rulesview10 – 20

    The view pg_hba_file_rules provides a summary of the contents of the client authentication configuration file, pg_hba.conf. A row appears in this view for each non-empty, non-comment line in the file, with annotations indicating whether the rule could be applied successfully. This view can be helpful for checking whether planned changes in the authentication configuration file will work, or for diagnosing a previous failure. Note that this view reports on the current contents of the file, not on what was last loaded by the server. By default, the pg_hba_file_rules view can be read only by superusers.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • The view pg_ident_file_mappings provides a summary of the contents of the client user name mapping configuration file, pg_ident.conf. A row appears in this view for each non-empty, non-comment line in the file, with annotations indicating whether the map could be applied successfully. This view can be helpful for checking whether planned changes in the authentication configuration file will work, or for diagnosing a previous failure. Note that this view reports on the current contents of the file, not on what was last loaded by the server. By default, the pg_ident_file_mappings view can be read only by superusers.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_indexcatalog7.4 – 20

    The catalog pg_index contains part of the information about indexes. The rest is mostly in pg_class.

  • pg_indexesview7.4 – 20

    The view pg_indexes provides access to useful information about each index in the database.

  • pg_inheritscatalog7.4 – 20

    The catalog pg_inherits records information about table and index inheritance hierarchies. There is one entry for each direct parent-child table or index relationship in the database. (Indirect inheritance can be determined by following chains of entries.)

  • pg_init_privscatalog9.6 – 20

    The catalog pg_init_privs records information about the initial privileges of objects in the system. There is one entry for each object in the database which has a non-default (non-NULL) initial set of privileges. Objects can have initial privileges either by having those privileges set when the system is initialized (by initdb) or when the object is created during a CREATE EXTENSION and the extension script sets initial privileges using the GRANT system. Note that the system will automatically handle recording of the privileges during the extension script and that extension authors need only use the GRANT and REVOKE statements in their script to have the privileges recorded. The privtype column indicates if the initial privilege was set by initdb or during a CREATE EXTENSION command. Objects which have initial privileges set by initdb will have entries where privtype is 'i', while objects which have initial privileges set by CREATE EXTENSION will have entries where privtype is 'e'.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_languagecatalog7.4 – 20

    The catalog pg_language registers languages in which you can write functions or stored procedures. See CREATE LANGUAGE and Chapter 40 for more information about language handlers.

  • pg_largeobjectcatalog7.4 – 20

    The catalog pg_largeobject holds the data making up “large objects”. A large object is identified by an OID assigned when it is created. Each large object is broken into segments or “pages” small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently BLCKSZ/4, or typically 2 kB). Prior to PostgreSQL 9.0, there was no permission structure associated with large objects. As a result, pg_largeobject was publicly readable and could be used to obtain the OIDs (and contents) of all large objects in the system. This is no longer the case; use pg_largeobject_metadata to obtain a list of large object OIDs.

  • pg_largeobject_metadatacatalog9.0 – 20

    The catalog pg_largeobject_metadata holds metadata associated with large objects. The actual large object data is stored in pg_largeobject.

  • pg_locksview7.4 – 20

    The view pg_locks provides access to information about the locks held by active processes within the database server. See Chapter 13 for more discussion of locking. pg_locks contains one row per active lockable object, requested lock mode, and relevant process. Thus, the same lockable object might appear many times, if multiple processes are holding or waiting for locks on it. However, an object that currently has no locks on it will not appear at all. There are several distinct types of lockable objects: whole relations (e.g., tables), individual pages of relations, individual tuples of relations, transaction IDs (both virtual and permanent IDs), and general database objects (identified by class OID and object OID, in the same way as in pg_description or pg_depend). Also, the right to extend a relation is represented as a separate lockable object, as is the right to update pg_database.datfrozenxid. Also, “advisory” locks can be taken on numbers that have user-defined meanings.

  • pg_matviewsview9.3 – 20

    The view pg_matviews provides access to useful information about each materialized view in the database.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_namespacecatalog7.4 – 20

    The catalog pg_namespace stores namespaces. A namespace is the structure underlying SQL schemas: each namespace can have a separate collection of relations, types, etc. without name conflicts.

  • pg_opclasscatalog7.4 – 20

    The catalog pg_opclass defines index access method operator classes. Each operator class defines semantics for index columns of a particular data type and a particular index access method. An operator class essentially specifies that a particular operator family is applicable to a particular indexable column data type. The set of operators from the family that are actually usable with the indexed column are whichever ones accept the column's data type as their left-hand input. Operator classes are described at length in Section 36.16.

  • pg_operatorcatalog7.4 – 20

    The catalog pg_operator stores information about operators. See CREATE OPERATOR and Section 36.14 for more information.

  • pg_opfamilycatalog8.3 – 20

    The catalog pg_opfamily defines operator families. Each operator family is a collection of operators and associated support routines that implement the semantics specified for a particular index access method. Furthermore, the operators in a family are all “compatible”, in a way that is specified by the access method. The operator family concept allows cross-data-type operators to be used with indexes and to be reasoned about using knowledge of access method semantics. Operator families are described at length in Section 36.16.

  • pg_parameter_aclcatalog15 – 20

    The catalog pg_parameter_acl records configuration parameters for which privileges have been granted to one or more roles. No entry is made for parameters that have default privileges. Unlike most system catalogs, pg_parameter_acl is shared across all databases of a cluster: there is only one copy of pg_parameter_acl per cluster, not one per database.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_partitioned_tablecatalog10 – 20

    The catalog pg_partitioned_table stores information about how tables are partitioned.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_policiesview9.5 – 20

    The view pg_policies provides access to useful information about each row-level security policy in the database.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_policycatalog9.5 – 20

    The catalog pg_policy stores row-level security policies for tables. A policy includes the kind of command that it applies to (possibly all commands), the roles that it applies to, the expression to be added as a security-barrier qualification to queries that include the table, and the expression to be added as a WITH CHECK option for queries that attempt to add new records to the table.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • The pg_prepared_statements view displays all the prepared statements that are available in the current session. See PREPARE for more information about prepared statements. pg_prepared_statements contains one row for each prepared statement. Rows are added to the view when a new prepared statement is created and removed when a prepared statement is released (for example, via the DEALLOCATE command).

  • pg_prepared_xactsview8.1 – 20

    The view pg_prepared_xacts displays information about transactions that are currently prepared for two-phase commit (see PREPARE TRANSACTION for details). pg_prepared_xacts contains one row per prepared transaction. An entry is removed when the transaction is committed or rolled back.

  • pg_proccatalog7.4 – 20

    The catalog pg_proc stores information about functions, procedures, aggregate functions, and window functions (collectively also known as routines). See CREATE FUNCTION, CREATE PROCEDURE, and Section 36.3 for more information. If prokind indicates that the entry is for an aggregate function, there should be a matching row in pg_aggregate.

  • pg_publicationcatalog10 – 20

    The catalog pg_publication contains all publications created in the database. For more on publications see Section 29.1.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_publication_namespacecatalog15 – 20

    The catalog pg_publication_namespace contains the mapping between schemas and publications in the database. This is a many-to-many mapping.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_publication_relcatalog10 – 20

    The catalog pg_publication_rel contains the mapping between relations and publications in the database. This is a many-to-many mapping. See also Section 53.18 for a more user-friendly view of this information.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • The view pg_publication_tables provides information about the mapping between publications and information of tables they contain. Unlike the underlying catalog pg_publication_rel, this view expands publications defined as FOR ALL TABLES and FOR TABLES IN SCHEMA, so for such publications there will be a row for each eligible table.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_rangecatalog9.2 – 20

    The catalog pg_range stores information about range types. This is in addition to the types' entries in pg_type.

  • pg_replication_origincatalog9.5 – 20

    The pg_replication_origin catalog contains all replication origins created. For more on replication origins see Chapter 48. Unlike most system catalogs, pg_replication_origin is shared across all databases of a cluster: there is only one copy of pg_replication_origin per cluster, not one per database.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • The pg_replication_origin_status view contains information about how far replay for a certain origin has progressed. For more on replication origins see Chapter 48.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_replication_slotsview9.4 – 20

    The pg_replication_slots view provides a listing of all replication slots that currently exist on the database cluster, along with their current state. For more on replication slots, see Section 26.2.6 and Chapter 47.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_rewritecatalog7.4 – 20

    The catalog pg_rewrite stores rewrite rules for tables and views.

  • pg_rolesview8.1 – 20

    The view pg_roles provides access to information about database roles. This is simply a publicly readable view of pg_authid that blanks out the password field.

  • pg_rulesview7.4 – 20

    The view pg_rules provides access to useful information about query rewrite rules.

  • pg_seclabelcatalog9.1 – 20

    The catalog pg_seclabel stores security labels on database objects. Security labels can be manipulated with the SECURITY LABEL command. For an easier way to view security labels, see Section 53.23. See also pg_shseclabel, which performs a similar function for security labels of database objects that are shared across a database cluster.

  • pg_seclabelsview9.1 – 20

    The view pg_seclabels provides information about security labels. It as an easier-to-query version of the pg_seclabel catalog.

  • pg_sequencecatalog10 – 20

    The catalog pg_sequence contains information about sequences. Some of the information about sequences, such as the name and the schema, is in pg_class

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_sequencesview10 – 20

    The view pg_sequences provides access to useful information about each sequence in the database.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_settingsview7.4 – 20

    The view pg_settings provides access to run-time parameters of the server. It is essentially an alternative interface to the SHOW and SET commands. It also provides access to some facts about each parameter that are not directly available from SHOW, such as minimum and maximum values.

  • pg_shadowview7.4 – 20

    The view pg_shadow exists for backwards compatibility: it emulates a catalog that existed in PostgreSQL before version 8.1. It shows properties of all roles that are marked as rolcanlogin in pg_authid. The name stems from the fact that this table should not be readable by the public since it contains passwords. pg_user is a publicly readable view on pg_shadow that blanks out the password field.

  • pg_shdependcatalog8.1 – 20

    The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL to ensure that those objects are unreferenced before attempting to delete them. See also pg_depend, which performs a similar function for dependencies involving objects within a single database. Unlike most system catalogs, pg_shdepend is shared across all databases of a cluster: there is only one copy of pg_shdepend per cluster, not one per database.

  • pg_shdescriptioncatalog8.2 – 20

    The catalog pg_shdescription stores optional descriptions (comments) for shared database objects. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. See also pg_description, which performs a similar function for descriptions involving objects within a single database. Unlike most system catalogs, pg_shdescription is shared across all databases of a cluster: there is only one copy of pg_shdescription per cluster, not one per database.

  • The pg_shmem_allocations view shows allocations made from the server's main shared memory segment. This includes both memory allocated by PostgreSQL itself and memory allocated by extensions using the mechanisms detailed in Section 36.10.11. Note that this view does not include memory allocated using the dynamic shared memory infrastructure.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • The pg_shmem_allocations_numa shows how shared memory allocations in the server's main shared memory segment are distributed across NUMA nodes. This includes both memory allocated by PostgreSQL itself and memory allocated by extensions using the mechanisms detailed in Section 36.10.11. This view will output multiple rows for each of the shared memory segments provided that they are spread across multiple NUMA nodes. This view should not be queried by monitoring systems as it is very slow and may end up allocating shared memory in case it was not used earlier. Current limitation for this view is that won't show anonymous shared memory allocations. Note that this view does not include memory allocated using the dynamic shared memory infrastructure.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_shseclabelcatalog9.2 – 20

    The catalog pg_shseclabel stores security labels on shared database objects. Security labels can be manipulated with the SECURITY LABEL command. For an easier way to view security labels, see Section 53.23. See also pg_seclabel, which performs a similar function for security labels involving objects within a single database. Unlike most system catalogs, pg_shseclabel is shared across all databases of a cluster: there is only one copy of pg_shseclabel per cluster, not one per database.

  • pg_stat_activitystatistics7.4 – 20

    The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.

  • pg_stat_all_indexesstatistics7.4 – 20

    The pg_stat_all_indexes view will contain one row for each index in the current database, showing statistics about accesses to that specific index. The pg_stat_user_indexes and pg_stat_sys_indexes views contain the same information, but filtered to only show user and system indexes respectively.

  • pg_stat_all_tablesstatistics7.4 – 20

    The pg_stat_all_tables view will contain one row for each table in the current database (including TOAST tables), showing statistics about accesses to that specific table. The pg_stat_user_tables and pg_stat_sys_tables views contain the same information, but filtered to only show user and system tables respectively.

  • pg_stat_archiverstatistics9.4 – 20

    The pg_stat_archiver view will always have a single row, containing data about the archiver process of the cluster.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_bgwriterstatistics8.3 – 20

    The pg_stat_bgwriter view will always have a single row, containing data about the background writer of the cluster.

  • pg_stat_checkpointerstatistics17 – 20

    The pg_stat_checkpointer view will always have a single row, containing data about the checkpointer process of the cluster.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_databasestatistics7.4 – 20

    The pg_stat_database view will contain one row for each database in the cluster, plus one for shared objects, showing database-wide statistics.

  • pg_stat_database_conflictsstatistics9.1 – 20

    The pg_stat_database_conflicts view will contain one row per database, showing database-wide statistics about query cancels occurring due to conflicts with recovery on standby servers. This view will only contain information on standby servers, since conflicts do not occur on primary servers.

  • pg_stat_gssapistatistics12 – 20

    The pg_stat_gssapi view will contain one row per backend, showing information about GSSAPI usage on this connection. It can be joined to pg_stat_activity or pg_stat_replication on the pid column to get more details about the connection.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_iostatistics16 – 20

    The pg_stat_io view will contain one row for each combination of backend type, target I/O object, and I/O context, showing cluster-wide I/O statistics. Combinations which do not make sense are omitted. Currently, I/O on relations (e.g. tables, indexes) and WAL activity are tracked. However, relation I/O which bypasses shared buffers (e.g. when moving a table from one tablespace to another) is currently not tracked.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_progress_analyzeprogress13 – 20

    Whenever ANALYZE is running, the pg_stat_progress_analyze view will contain a row for each backend that is currently running that command. The tables below describe the information that will be reported and provide information about how to interpret it.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • Whenever an application like pg_basebackup is taking a base backup, the pg_stat_progress_basebackup view will contain a row for each WAL sender process that is currently running the BASE_BACKUP replication command and streaming the backup. The tables below describe the information that will be reported and provide information about how to interpret it.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_progress_clusterprogress12 – 20

    Whenever CLUSTER or VACUUM FULL is running, the pg_stat_progress_cluster view will contain a row for each backend that is currently running either command. The tables below describe the information that will be reported and provide information about how to interpret it.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_progress_copyprogress14 – 20

    Whenever COPY is running, the pg_stat_progress_copy view will contain one row for each backend that is currently running a COPY command. The table below describes the information that will be reported and provides information about how to interpret it.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • Whenever CREATE INDEX or REINDEX is running, the pg_stat_progress_create_index view will contain one row for each backend that is currently creating indexes. The tables below describe the information that will be reported and provide information about how to interpret it.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_progress_vacuumprogress9.6 – 20

    Whenever VACUUM is running, the pg_stat_progress_vacuum view will contain one row for each backend (including autovacuum worker processes) that is currently vacuuming. The tables below describe the information that will be reported and provide information about how to interpret it. Progress for VACUUM FULL commands is reported via pg_stat_progress_cluster because both VACUUM FULL and CLUSTER rewrite the table, while regular VACUUM only modifies it in place. See Section 27.4.2.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_recovery_prefetchstatistics15 – 20

    The pg_stat_recovery_prefetch view will contain only one row. The columns wal_distance, block_distance and io_depth show current values, and the other columns show cumulative counters that can be reset with the pg_stat_reset_shared function.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_replicationstatistics9.1 – 20

    The pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server. Only directly connected standbys are listed; no information is available about downstream standby servers.

  • pg_stat_replication_slotsstatistics14 – 20

    The pg_stat_replication_slots view will contain one row per logical replication slot, showing statistics about its usage.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_slrustatistics13 – 20

    PostgreSQL accesses certain on-disk information via SLRU (simple least-recently-used) caches. The pg_stat_slru view will contain one row for each tracked SLRU cache, showing statistics about access to cached pages. For each SLRU cache that's part of the core server, there is a configuration parameter that controls its size, with the suffix _buffers appended.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_sslstatistics9.5 – 20

    The pg_stat_ssl view will contain one row per backend or WAL sender process, showing statistics about SSL usage on this connection. It can be joined to pg_stat_activity or pg_stat_replication on the pid column to get more details about the connection.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_subscriptionstatistics10 – 20

    At least one row per subscription, showing information about the subscription workers. See pg_stat_subscription for details.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_subscription_statsstatistics15 – 20

    The pg_stat_subscription_stats view will contain one row per subscription.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_sys_indexesstatistics7.4 – 20

    Same as pg_stat_all_indexes, except that only indexes on system tables are shown.

  • pg_stat_sys_tablesstatistics7.4 – 20

    Same as pg_stat_all_tables, except that only system tables are shown.

  • pg_stat_user_functionsstatistics8.4 – 20

    The pg_stat_user_functions view will contain one row for each tracked function, showing statistics about executions of that function. The track_functions parameter controls exactly which functions are tracked.

  • pg_stat_user_indexesstatistics7.4 – 20

    Same as pg_stat_all_indexes, except that only indexes on user tables are shown.

  • pg_stat_user_tablesstatistics7.4 – 20

    Same as pg_stat_all_tables, except that only user tables are shown.

  • pg_stat_walstatistics14 – 20

    The pg_stat_wal view will always have a single row, containing data about WAL activity of the cluster.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_wal_receiverstatistics9.6 – 20

    The pg_stat_wal_receiver view will contain only one row, showing statistics about the WAL receiver from that receiver's connected server.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stat_xact_all_tablesstatistics9.1 – 20

    Similar to pg_stat_all_tables, but counts actions taken so far within the current transaction (which are not yet included in pg_stat_all_tables and related views). The columns for numbers of live and dead rows and vacuum and analyze actions are not present in this view.

  • pg_stat_xact_sys_tablesstatistics9.1 – 20

    Same as pg_stat_xact_all_tables, except that only system tables are shown.

  • pg_stat_xact_user_functionsstatistics9.1 – 20

    Similar to pg_stat_user_functions, but counts only calls during the current transaction (which are not yet included in pg_stat_user_functions).

  • pg_stat_xact_user_tablesstatistics9.1 – 20

    Same as pg_stat_xact_all_tables, except that only user tables are shown.

  • pg_statio_all_indexesstatistics7.4 – 20

    The pg_statio_all_indexes view will contain one row for each index in the current database, showing statistics about I/O on that specific index. The pg_statio_user_indexes and pg_statio_sys_indexes views contain the same information, but filtered to only show user and system indexes respectively.

  • pg_statio_all_sequencesstatistics7.4 – 20

    The pg_statio_all_sequences view will contain one row for each sequence in the current database, showing statistics about I/O on that specific sequence.

  • pg_statio_all_tablesstatistics7.4 – 20

    The pg_statio_all_tables view will contain one row for each table in the current database (including TOAST tables), showing statistics about I/O on that specific table. The pg_statio_user_tables and pg_statio_sys_tables views contain the same information, but filtered to only show user and system tables respectively.

  • pg_statio_sys_indexesstatistics7.4 – 20

    Same as pg_statio_all_indexes, except that only indexes on system tables are shown.

  • pg_statio_sys_sequencesstatistics7.4 – 20

    Same as pg_statio_all_sequences, except that only system sequences are shown. (Presently, no system sequences are defined, so this view is always empty.)

  • pg_statio_sys_tablesstatistics7.4 – 20

    Same as pg_statio_all_tables, except that only system tables are shown.

  • pg_statio_user_indexesstatistics7.4 – 20

    Same as pg_statio_all_indexes, except that only indexes on user tables are shown.

  • pg_statio_user_sequencesstatistics7.4 – 20

    Same as pg_statio_all_sequences, except that only user sequences are shown.

  • pg_statio_user_tablesstatistics7.4 – 20

    Same as pg_statio_all_tables, except that only user tables are shown.

  • pg_statisticcatalog7.4 – 20

    The catalog pg_statistic stores statistical data about the contents of the database. Entries are created by ANALYZE and subsequently used by the query planner. Note that all the statistical data is inherently approximate, even assuming that it is up-to-date. Normally there is one entry, with stainherit = false, for each table column that has been analyzed. If the table has inheritance children or partitions, a second entry with stainherit = true is also created. This row represents the column's statistics over the inheritance tree, i.e., statistics for the data you'd see with SELECT column FROM table*, whereas the stainherit = false row represents the results of SELECT column FROM ONLY table. pg_statistic also stores statistical data about the values of index expressions. These are described as if they were actual data columns; in particular, starelid references the index. No entry is made for an ordinary non-expression index column, however, since it would be redundant with the entry for the underlying table column. Currently, entries for index expressions always have stainherit = false. Since different kinds of statistics might be appropriate for different kinds of data, pg_statistic is designed not to assume very much about what sort of statistics it stores. Only extremely general statistics (such as nullness) are given dedicated columns in pg_statistic. Everything else is stored in “slots”, which are groups of associated columns whose content is identified by a code number in one of the slot's columns. For more information see src/include/catalog/pg_statistic.h. pg_statistic should not be readable by the public, since even statistical information about a table's contents might be considered sensitive. (Example: minimum and maximum values of a salary column might be quite interesting.) pg_stats is a publicly readable view on pg_statistic that only exposes information about those tables that are readable by the current user.

  • pg_statistic_extcatalog10 – 20

    The catalog pg_statistic_ext holds definitions of extended planner statistics. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_statistic_ext_datacatalog12 – 20

    The catalog pg_statistic_ext_data holds data for extended planner statistics defined in pg_statistic_ext. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS. Normally there is one entry, with stxdinherit = false, for each statistics object that has been analyzed. If the table has inheritance children or partitions, a second entry with stxdinherit = true is also created. This row represents the statistics object over the inheritance tree, i.e., statistics for the data you'd see with SELECT * FROM table*, whereas the stxdinherit = false row represents the results of SELECT * FROM ONLY table. Like pg_statistic, pg_statistic_ext_data should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite interesting.) pg_stats_ext is a publicly readable view on pg_statistic_ext_data (after joining with pg_statistic_ext) that only exposes information about tables the current user owns.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_statsview7.4 – 20

    The view pg_stats provides access to the information stored in the pg_statistic catalog. This view allows access only to rows of pg_statistic that correspond to tables the user has permission to read, and therefore it is safe to allow public read access to this view. pg_stats is also designed to present the information in a more readable format than the underlying catalog — at the cost that its schema must be extended whenever new slot types are defined for pg_statistic.

  • pg_stats_extview12 – 20

    The view pg_stats_ext provides access to information about each extended statistics object in the database, combining information stored in the pg_statistic_ext and pg_statistic_ext_data catalogs. This view allows access only to rows of pg_statistic_ext and pg_statistic_ext_data that correspond to tables the user owns, and therefore it is safe to allow public read access to this view. pg_stats_ext is also designed to present the information in a more readable format than the underlying catalogs — at the cost that its schema must be extended whenever new types of extended statistics are added to pg_statistic_ext.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_stats_ext_exprsview14 – 20

    The view pg_stats_ext_exprs provides access to information about all expressions included in extended statistics objects, combining information stored in the pg_statistic_ext and pg_statistic_ext_data catalogs. This view allows access only to rows of pg_statistic_ext and pg_statistic_ext_data that correspond to tables the user owns, and therefore it is safe to allow public read access to this view. pg_stats_ext_exprs is also designed to present the information in a more readable format than the underlying catalogs — at the cost that its schema must be extended whenever the structure of statistics in pg_statistic_ext changes.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_subscriptioncatalog10 – 20

    The catalog pg_subscription contains all existing logical replication subscriptions. For more information about logical replication see Chapter 29. Unlike most system catalogs, pg_subscription is shared across all databases of a cluster: there is only one copy of pg_subscription per cluster, not one per database. Access to the column subconninfo is revoked from normal users, because it could contain plain-text passwords.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_subscription_relcatalog10 – 20

    The catalog pg_subscription_rel contains the state for each replicated relation in each subscription. This is a many-to-many mapping. This catalog only contains tables known to the subscription after running either CREATE SUBSCRIPTION or ALTER SUBSCRIPTION ... REFRESH PUBLICATION.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_tablesview7.4 – 20

    The view pg_tables provides access to useful information about each table in the database.

  • pg_tablespacecatalog8.0 – 20

    The catalog pg_tablespace stores information about the available tablespaces. Tables can be placed in particular tablespaces to aid administration of disk layout. Unlike most system catalogs, pg_tablespace is shared across all databases of a cluster: there is only one copy of pg_tablespace per cluster, not one per database.

  • pg_timezone_abbrevsview8.2 – 20

    The view pg_timezone_abbrevs provides a list of time zone abbreviations that are currently recognized by the datetime input routines. The contents of this view change when the TimeZone or timezone_abbreviations run-time parameters are modified.

  • pg_timezone_namesview8.2 – 20

    The view pg_timezone_names provides a list of time zone names that are recognized by SET TIMEZONE, along with their associated abbreviations, UTC offsets, and daylight-savings status. (Technically, PostgreSQL does not use UTC because leap seconds are not handled.) Unlike the abbreviations shown in pg_timezone_abbrevs, many of these names imply a set of daylight-savings transition date rules. Therefore, the associated information changes across local DST boundaries. The displayed information is computed based on the current value of CURRENT_TIMESTAMP.

  • pg_transformcatalog9.5 – 20

    The catalog pg_transform stores information about transforms, which are a mechanism to adapt data types to procedural languages. See CREATE TRANSFORM for more information.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • pg_triggercatalog7.4 – 20

    The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.

  • pg_ts_configcatalog8.3 – 20

    The pg_ts_config catalog contains entries representing text search configurations. A configuration specifies a particular text search parser and a list of dictionaries to use for each of the parser's output token types. The parser is shown in the pg_ts_config entry, but the token-to-dictionary mapping is defined by subsidiary entries in pg_ts_config_map. PostgreSQL's text search features are described at length in Chapter 12.

  • pg_ts_config_mapcatalog8.3 – 20

    The pg_ts_config_map catalog contains entries showing which text search dictionaries should be consulted, and in what order, for each output token type of each text search configuration's parser. PostgreSQL's text search features are described at length in Chapter 12.

  • pg_ts_dictcatalog8.3 – 20

    The pg_ts_dict catalog contains entries defining text search dictionaries. A dictionary depends on a text search template, which specifies all the implementation functions needed; the dictionary itself provides values for the user-settable parameters supported by the template. This division of labor allows dictionaries to be created by unprivileged users. The parameters are specified by a text string dictinitoption, whose format and meaning vary depending on the template. PostgreSQL's text search features are described at length in Chapter 12.

  • pg_ts_parsercatalog8.3 – 20

    The pg_ts_parser catalog contains entries defining text search parsers. A parser is responsible for splitting input text into lexemes and assigning a token type to each lexeme. Since a parser must be implemented by C-language-level functions, creation of new parsers is restricted to database superusers. PostgreSQL's text search features are described at length in Chapter 12.

  • pg_ts_templatecatalog8.3 – 20

    The pg_ts_template catalog contains entries defining text search templates. A template is the implementation skeleton for a class of text search dictionaries. Since a template must be implemented by C-language-level functions, creation of new templates is restricted to database superusers. PostgreSQL's text search features are described at length in Chapter 12.

  • pg_typecatalog7.4 – 20

    The catalog pg_type stores information about data types. Base types and enum types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN. A composite type is automatically created for each table in the database, to represent the row structure of the table. It is also possible to create composite types with CREATE TYPE AS.

  • pg_userview7.4 – 20

    The view pg_user provides access to information about database users. This is simply a publicly readable view of pg_shadow that blanks out the password field.

  • pg_user_mappingcatalog8.4 – 20

    The catalog pg_user_mapping stores the mappings from local user to remote. Access to this catalog is restricted from normal users, use the view pg_user_mappings instead.

  • pg_user_mappingsview8.4 – 20

    The view pg_user_mappings provides access to information about user mappings. This is essentially a publicly readable view of pg_user_mapping that leaves out the options field if the user has no rights to use it.

  • pg_viewsview7.4 – 20

    The view pg_views provides access to useful information about each view in the database.

  • pg_wait_eventsview17 – 20

    The view pg_wait_events provides description about the wait events.

    7.48.08.18.28.38.49.09.19.29.39.49.59.61011121314151617181920