Catalogs: pg_tablespace

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. Table 50-47. pg_tablespace Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) spcname name Tablespace name

Catalogs: pg_tables

The view pg_tables provides access to useful information about each table in the database. Table 50-79. pg_tables Columns Name Type References Description schemaname name pg_namespace.nspname Name of schema containing table tablename name pg_class.relname Name of table tableowner name pg_authid.rolname Name of table's owner tablespace name pg_tablespace.spcname Name of tablespace containing table (null if default for database) hasindexes boolean pg_class.relhasindex True if table has (or rece

Catalogs: pg_stats

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. Table 50-78. pg_stats

Catalogs: pg_statistic

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, a second entry with stainherit = true is also created. This row represents the column's statistics ov

Catalogs: pg_shseclabel

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 50.74. 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. Table 5

Catalogs: pg_shdescription

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. Table 50-44. pg_s

Catalogs: pg_shdepend

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

Catalogs: pg_shadow

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. Table 50-77. pg_shadow Columns Name Type References Description usename name pg_authid.rolname User

Catalogs: pg_settings

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. Table 50-76. pg_settings Columns Name Type Description name text Run-time configuration parameter name setting text Current value of the parameter unit text Implicit unit of the parameter category text Logical g

Catalogs: pg_seclabels

The view pg_seclabels provides information about security labels. It as an easier-to-query version of the pg_seclabel catalog. Table 50-75. pg_seclabels Columns Name Type References Description objoid oid any OID column The OID of the object this security label pertains to classoid oid pg_class.oid The OID of the system catalog this object appears in objsubid int4 For a security label on a table column, this is the column number (the objoid and classoid refer to the table itself). For all o