pg_class
The pg_class stores information about tables, indexes, views, and other relations in the database. It contains one row for each relation. This includes each table in a Redpanda catalog or Iceberg catalog, and each nested composite type in those tables. It mimics the pg_class PostgreSQL system catalog.
Columns
The following columns are available for querying in pg_class:
| Column | Type | Description |
|---|---|---|
|
|
This column represents the object ID (OID) of the relation that Redpanda SQL generates. |
|
|
This column represents the name of the relation. For a table in an Iceberg catalog, the name includes the Iceberg namespace, such as |
|
|
This column represents the OID of the schema that holds the relation |
|
|
Returns |
|
|
This column represents the type of relation: |
|
|
Unused |
|
|
Unused |
|
|
This column represents the OID of the role that owns the relation. References |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
|
|
Unused |
Examples
List the views and the tables in Redpanda catalogs and Iceberg catalogs that you can see:
SELECT oid, relname, relkind
FROM pg_class
WHERE relkind IN ('v', 'f')
ORDER BY relkind, relname;
The query returns one row for each view (relkind v) and one row for each table in a catalog (relkind f). To find the catalog that a table belongs to, join to pg_foreign_table.