Skip to main content
For PostgreSQL compatibility, CockroachDB includes a called pg_catalog. The tables in the pg_catalog schema roughly correspond to the system catalogs in PostgreSQL. pg_catalog tables are read-only.

Data exposed by pg_catalog

The tables in CockroachDB’s pg_catalog schema correspond to a subset of the virtual tables and views that make up the PostgreSQL system catalogs. Not all PostgreSQL system catalogs have a corresponding table in pg_catalog, and some of the pg_catalog tables are empty. See the following table for a detailed comparison between PostgreSQL 13 system catalogs and pg_catalog tables.
PostgreSQL 13 system catalogpg_catalog table
pg_aggregatepg_aggregate
pg_ampg_am
pg_amoppg_amop (empty)
pg_amprocpg_amproc (empty)
pg_attrdefpg_attrdef
pg_attributepg_attribute
pg_auth_memberspg_auth_members
pg_authidpg_authid
pg_available_extension_versionspg_available_extension_versions (empty)
pg_available_extensionspg_available_extensions
pg_castpg_cast
pg_classpg_class
pg_collationpg_collation
pg_configpg_config (empty)
pg_constraintpg_constraint
pg_conversionpg_conversion
pg_cursors
pg_databasepg_database
pg_db_role_settingpg_db_role_setting
pg_default_aclpg_default_acl
pg_dependpg_depend
pg_descriptionpg_description
pg_enumpg_enum
pg_event_triggerpg_event_trigger
pg_extensionpg_extension
pg_file_settingspg_file_settings (empty)
pg_foreign_data_wrapperpg_foreign_data_wrapper
pg_foreign_serverpg_foreign_server
pg_foreign_tablepg_foreign_table
pg_grouppg_group (empty)
pg_hba_file_rulespg_hba_file_rules (empty)
pg_indexpg_index
pg_indexespg_indexes
pg_inheritspg_inherits
pg_init_privspg_init_privs (empty)
pg_languagepg_language (empty)
pg_largeobjectpg_largeobject (empty)
pg_largeobject_metadatapg_largeobject_metadata (empty)
pg_lockspg_locks
pg_matviewspg_matviews
pg_namespacepg_namespace
pg_opclasspg_opclass (empty)
pg_operatorpg_operator
pg_opfamilypg_opfamily (empty)
pg_partitioned_tablepg_partitioned_table (empty)
pg_policiespg_policies (empty)
pg_policypg_policy (empty)
pg_prepared_statementspg_prepared_statements (empty)
pg_prepared_xactspg_prepared_xacts (empty)
pg_procpg_proc
pg_publicationpg_publication (empty)
pg_publication_relpg_publication_rel (empty)
pg_publication_tablespg_publication_tables (empty)
pg_rangepg_range
pg_replication_originpg_replication_origin (empty)
pg_replication_origin_statuspg_replication_origin_status (empty)
pg_replication_slotspg_replication_slots (empty)
pg_rewritepg_rewrite
pg_rolespg_roles
pg_rulespg_rules (empty)
pg_seclabelpg_seclabel
pg_seclabelspg_seclabels
pg_sequencepg_sequence
pg_sequencespg_sequences
pg_settingspg_settings
pg_shadowpg_shadow (empty)
pg_shdependpg_shdepend
pg_shdescriptionpg_shdescription
pg_shmem_allocationspg_shmem_allocations (empty)
pg_shseclabelpg_shseclabel
pg_stat_activitypg_stat_activity (empty)
pg_stat_all_indexespg_stat_all_indexes (empty)
pg_stat_all_tablespg_stat_all_tables (empty)
pg_stat_archiverpg_stat_archiver (empty)
pg_stat_bgwriterpg_stat_bgwriter (empty)
pg_stat_databasepg_stat_database (empty)
pg_stat_database_conflictspg_stat_database_conflicts (empty)
pg_stat_gssapipg_stat_gssapi (empty)
pg_stat_progress_analyzepg_stat_progress_analyze (empty)
pg_stat_progress_basebackuppg_stat_progress_basebackup (empty)
pg_stat_progress_clusterpg_stat_progress_cluster (empty)
pg_stat_progress_create_indexpg_stat_progress_create_index (empty)
pg_stat_progress_vacuumpg_stat_progress_vacuum (empty)
pg_stat_replicationpg_stat_replication (empty)
pg_stat_slrupg_stat_slru (empty)
pg_stat_sslpg_stat_ssl (empty)
pg_stat_subscriptionpg_stat_subscription (empty)
pg_stat_sys_indexespg_stat_sys_indexes (empty)
pg_stat_sys_tablespg_stat_sys_tables (empty)
pg_stat_user_functionspg_stat_user_functions (empty)
pg_stat_user_indexespg_stat_user_indexes (empty)
pg_stat_user_tablespg_stat_user_tables (empty)
pg_stat_wal_receiverpg_stat_wal_receiver (empty)
pg_stat_xact_all_tablespg_stat_xact_all_tables (empty)
pg_stat_xact_sys_tablespg_stat_xact_sys_tables (empty)
pg_stat_xact_user_functionspg_stat_xact_user_functions (empty)
pg_stat_xact_user_tablespg_stat_xact_user_tables (empty)
pg_statio_all_indexespg_statio_all_indexes (empty)
pg_statio_all_sequencespg_statio_all_sequences (empty)
pg_statio_all_tablespg_statio_all_tables (empty)
pg_statio_sys_indexespg_statio_sys_indexes (empty)
pg_statio_sys_sequencespg_statio_sys_sequences (empty)
pg_statio_sys_tablespg_statio_sys_tables (empty)
pg_statio_user_indexespg_statio_user_indexes (empty)
pg_statio_user_sequencespg_statio_user_sequences (empty)
pg_statio_user_tablespg_statio_user_tables (empty)
pg_statisticNone
pg_statistic_extpg_statistic_ext (empty)
pg_statistic_ext_dataNone
pg_statsNone
pg_stats_extNone
pg_subscriptionpg_subscription (empty)
pg_subscription_relpg_subscription_rel (empty)
pg_tablespg_tables
pg_tablespacepg_tablespace
pg_timezone_abbrevspg_timezone_abbrevs (empty)
pg_timezone_namespg_timezone_names
pg_transformpg_transform (empty)
pg_triggerpg_trigger
pg_ts_configpg_ts_config (empty)
pg_ts_config_mappg_ts_config_map (empty)
pg_ts_dictpg_ts_dict (empty)
pg_ts_parserpg_ts_parser (empty)
pg_ts_templatepg_ts_template (empty)
pg_typepg_type
pg_userpg_user
pg_user_mappingpg_user_mapping
pg_user_mappingspg_user_mappings (empty)
pg_viewspg_views
To list the tables in pg_catalog for the , use the following statement:
To prohibit queries against empty tables, set the stub_catalog_tables to off.

Query pg_catalog tables

You can run on the tables in pg_catalog.
To ensure that you can view all of the tables in pg_catalog, query the tables as a user with .
Unless specified otherwise, queries to pg_catalog assume the .
For example, to return the pg_catalog table with additional information about indexes in , you can query the pg_catalog.pg_indexes table:

See also