Supported Versions: Current (16) / 15 / 14 / 13 / 12
Development Versions: devel
Unsupported versions: 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

Chapter 42. System Catalogs

Table of Contents
42.1. Overview
42.2. pg_aggregate
42.3. pg_am
42.4. pg_amop
42.5. pg_amproc
42.6. pg_attrdef
42.7. pg_attribute
42.8. pg_authid
42.9. pg_auth_members
42.10. pg_autovacuum
42.11. pg_cast
42.12. pg_class
42.13. pg_constraint
42.14. pg_conversion
42.15. pg_database
42.16. pg_depend
42.17. pg_description
42.18. pg_index
42.19. pg_inherits
42.20. pg_language
42.21. pg_largeobject
42.22. pg_listener
42.23. pg_namespace
42.24. pg_opclass
42.25. pg_operator
42.26. pg_pltemplate
42.27. pg_proc
42.28. pg_rewrite
42.29. pg_shdepend
42.30. pg_statistic
42.31. pg_tablespace
42.32. pg_trigger
42.33. pg_type
42.34. System Views
42.35. pg_group
42.36. pg_indexes
42.37. pg_locks
42.38. pg_prepared_xacts
42.39. pg_roles
42.40. pg_rules
42.41. pg_settings
42.42. pg_shadow
42.43. pg_stats
42.44. pg_tables
42.45. pg_user
42.46. 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.

42.1. Overview

Table 42-1 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 42-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_statistic planner statistics
pg_tablespace tablespaces within this database cluster
pg_trigger triggers
pg_type data types