Table of Contents
pg_aggregate
pg_am
pg_amop
pg_amproc
pg_attrdef
pg_attribute
pg_authid
pg_auth_members
pg_autovacuum
pg_cast
pg_class
pg_constraint
pg_conversion
pg_database
pg_depend
pg_description
pg_index
pg_inherits
pg_language
pg_largeobject
pg_listener
pg_namespace
pg_opclass
pg_operator
pg_pltemplate
pg_proc
pg_rewrite
pg_shdepend
pg_shdescription
pg_statistic
pg_tablespace
pg_trigger
pg_type
pg_cursors
pg_group
pg_indexes
pg_locks
pg_prepared_statements
pg_prepared_xacts
pg_roles
pg_rules
pg_settings
pg_shadow
pg_stats
pg_tables
pg_timezone_abbrevs
pg_timezone_names
pg_user
pg_views
The system catalogs are the place where a relational database
management system stores schema metadata, such as information about
tables and columns, and internal bookkeeping information.
PostgreSQL's system catalogs are regular
tables. You can drop and recreate the tables, add columns, insert
and update values, and severely mess up your system that way.
Normally, one should not change the system catalogs by hand, there
are always SQL commands to do that. (For example, CREATE
DATABASE
inserts a row into the
pg_database
catalog — and actually
creates the database on disk.) There are some exceptions for
particularly esoteric operations, such as adding index access methods.
Table 43.1, “System Catalogs” lists the system catalogs. More detailed documentation of each catalog follows below.
Most system catalogs are copied from the template database during database creation and are thereafter database-specific. A few catalogs are physically shared across all databases in a cluster; these are noted in the descriptions of the individual catalogs.
Table 43.1. System Catalogs
Catalog Name | Purpose |
---|---|
pg_aggregate |
aggregate functions |
pg_am |
index access methods |
pg_amop |
access method operators |
pg_amproc |
access method support procedures |
pg_attrdef |
column default values |
pg_attribute |
table columns (“attributes”) |
pg_authid |
authorization identifiers (roles) |
pg_auth_members |
authorization identifier membership relationships |
pg_autovacuum |
per-relation autovacuum configuration parameters |
pg_cast |
casts (data type conversions) |
pg_class |
tables, indexes, sequences, views (“relations”) |
pg_constraint |
check constraints, unique constraints, primary key constraints, foreign key constraints |
pg_conversion |
encoding conversion information |
pg_database |
databases within this database cluster |
pg_depend |
dependencies between database objects |
pg_description |
descriptions or comments on database objects |
pg_index |
additional index information |
pg_inherits |
table inheritance hierarchy |
pg_language |
languages for writing functions |
pg_largeobject |
large objects |
pg_listener |
asynchronous notification support |
pg_namespace |
schemas |
pg_opclass |
index access method operator classes |
pg_operator |
operators |
pg_pltemplate |
template data for procedural languages |
pg_proc |
functions and procedures |
pg_rewrite |
query rewrite rules |
pg_shdepend |
dependencies on shared objects |
pg_shdescription |
comments on shared objects |
pg_statistic |
planner statistics |
pg_tablespace |
tablespaces within this database cluster |
pg_trigger |
triggers |
pg_type |
data types |