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. 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