Skip to main content

Overview

The pg_class stores information about tables and indexes in the database. It contains exactly one row per table (or index) created in the database. It mimics the pg_class PostgreSQL system catalog.

Columns

This table is designed for compatibility with tools that require PostgreSQL system tables, so it mostly has dummy data. Please note that not all columns in pg_class are applicable to every type of relation.
The following columns are available for querying in pg_class:

Example

  1. Create a table and define its schema:
  1. Create an index on the customer_orders table for the customer_id column:
  1. Query the pg_class catalog to retrieve information about the customer_orders table and the index you’ve just created:
  1. The query will return information about the customer_orders table and the index: