Cloud

Information Schema

The information_schema namespace provides SQL-standard views over database object metadata. Use these views to inspect tables, columns, schemas, Redpanda catalogs and Iceberg catalogs, and privilege grants without querying the underlying PostgreSQL system catalogs directly.

Available views

Standard views follow the SQL specification, with semantics consistent with PostgreSQL’s information_schema. Redpanda SQL also adds one extension view for per-relation EXTERNAL SOURCE grants.

View Description

information_schema.character_sets

Character sets available in the current database.

information_schema.columns

Columns of tables visible to the current role, including tables in Redpanda catalogs and Iceberg catalogs. Does not include columns of views.

information_schema.foreign_data_wrappers

The two data sources that Redpanda SQL reads from: redpanda and iceberg. See Tables in Redpanda and Iceberg catalogs.

information_schema.foreign_servers

Redpanda catalogs and Iceberg catalogs visible to the current role. See Tables in Redpanda and Iceberg catalogs.

information_schema.foreign_tables

Tables in Redpanda catalogs and Iceberg catalogs visible to the current role, with the catalog that each table belongs to. See Tables in Redpanda and Iceberg catalogs.

information_schema.key_column_usage

Columns constrained as keys (primary keys, unique constraints, foreign keys).

information_schema.referential_constraints

Foreign-key constraints visible to the current role.

information_schema.role_external_relation_grants

Per-relation EXTERNAL SOURCE grants. Redpanda SQL extension that captures grants whose stored relation pattern is anything other than \* (catalog-level grants surface in information_schema.role_table_grants instead).

information_schema.role_table_grants

Privileges granted on tables and table-like objects to the current role.

information_schema.role_usage_grants

USAGE privileges granted to the current role.

information_schema.table_constraints

Table constraints (primary key, unique, foreign key, check) visible to the current role.

information_schema.tables

Tables visible to the current role. Tables in Redpanda catalogs and Iceberg catalogs have the table_type value FOREIGN. Does not include views.

Tables in Redpanda and Iceberg catalogs

Redpanda SQL lists tables in Redpanda catalogs and Iceberg catalogs as foreign tables, with the same model that PostgreSQL uses for foreign data:

  • Each catalog is a foreign server. The server name is the catalog name, such as default_redpanda_catalog.

  • Each server uses one of two foreign data wrappers: redpanda for Redpanda catalogs, or iceberg for Iceberg catalogs.

  • Each table in a catalog is a foreign table.

These tables appear in information_schema.tables with the table_type value FOREIGN, and their columns appear in information_schema.columns. To find the catalog that a table belongs to, query information_schema.foreign_tables.

In Redpanda Cloud, you can’t query a table in an Iceberg catalog directly. Query the topic’s table in the Redpanda catalog instead. See Query Iceberg-enabled topics.

The table_name value does not include the catalog name. For a table in an Iceberg catalog, the value includes the Iceberg namespace, such as redpanda.orders. For a topic-backed table in a Redpanda catalog, the value is the table name, such as orders.

Before Redpanda commits a topic’s first data to Iceberg, these views can already list the topic’s table in the Iceberg catalog, such as redpanda.accounts. The Iceberg table does not exist yet. Queries on the topic’s table in the Redpanda catalog are not affected.

Deleting a topic does not remove its tables from these views. To remove a table, run DROP TABLE <catalog>⇒<table>.

To see a catalog or a table in a catalog in these views, a role needs CONNECT on the database. The role also needs one of the following:

  • USAGE on the schema that holds the catalog.

  • Ownership of the catalog or the table. See ALTER …​ OWNER TO.

A GRANT …​ ON EXTERNAL SOURCE grant does not make a catalog or a table visible without USAGE. A role that can query a table in a catalog already has USAGE, so the role can also see the table. See GRANT.

The same rules apply to the pg_foreign_server, pg_foreign_table, and pg_class system catalogs.

information_schema.foreign_data_wrappers

Column Type Nullable Description

foreign_data_wrapper_catalog

text

No

Database that the foreign data wrapper belongs to.

foreign_data_wrapper_name

text

No

Name of the foreign data wrapper: redpanda or iceberg.

authorization_identifier

text

No

Unused. This column is always empty.

library_name

text

No

Unused. This column is always empty.

foreign_data_wrapper_language

text

No

Unused. This column is always c.

information_schema.foreign_servers

Column Type Nullable Description

foreign_server_catalog

text

No

Database that the catalog belongs to.

foreign_server_name

text

No

Name of the Redpanda catalog or Iceberg catalog.

foreign_data_wrapper_catalog

text

No

Database that the foreign data wrapper belongs to.

foreign_data_wrapper_name

text

No

Foreign data wrapper that the catalog uses: redpanda or iceberg.

foreign_server_type

text

No

Unused. This column is always empty.

foreign_server_version

text

No

Unused. This column is always empty.

authorization_identifier

text

No

Unused. This column is always empty.

information_schema.foreign_tables

Column Type Nullable Description

foreign_table_catalog

text

No

Database that the table belongs to.

foreign_table_schema

text

No

Schema that holds the catalog that the table belongs to.

foreign_table_name

text

No

Name of the table. Uses the same format as table_name in information_schema.tables.

foreign_server_catalog

text

No

Database that the catalog belongs to.

foreign_server_name

text

No

Name of the Redpanda catalog or Iceberg catalog that the table belongs to.

List each table in a catalog, with its catalog and data source:

SELECT ft.foreign_server_name, s.foreign_data_wrapper_name, ft.foreign_table_name
FROM information_schema.foreign_tables ft
JOIN information_schema.foreign_servers s
  ON s.foreign_server_name = ft.foreign_server_name
ORDER BY 1, 3;

information_schema.role_external_relation_grants

Per-relation EXTERNAL SOURCE grants. Rows whose stored relation pattern is anything other than *. Catalog-level EXTERNAL SOURCE grants (stored pattern \*) surface in information_schema.role_table_grants, like foreign-table grants in PostgreSQL.

When you GRANT …​ ON EXTERNAL SOURCE catalog_name ⇒ 'pattern', the pattern is stored verbatim. Redpanda SQL does not normalize or canonicalize it. Patterns are either a fully-qualified relation name like ns1.ns2.my_table or a name with a trailing wildcard like ns1.public_tables*. See GRANT for the full grant syntax and Manage access to Redpanda SQL for the access model.

Visibility mirrors information_schema.role_table_grants. A regular role sees rows where it is the grantee. A superuser sees grants for every non-superuser.

Use this view to find the exact stored relation pattern when you need to revoke a grant. REVOKE requires the pattern argument to match a stored grant exactly. Revoking a pattern that was never granted returns an error, so query this view first to see what’s currently registered.

Column Type Nullable Description

grantor

text

No

Role that granted the privilege.

grantee

text

No

Role that holds the privilege.

database_name

text

No

Database the grant applies to.

schema_name

text

No

Schema the grant applies to.

source_name

text

No

External source (catalog or storage) the grant applies to.

relation_pattern

text

No

Relation-name pattern the grant matches. Wildcards (\*) are allowed in the pattern.

privilege_type

text

No

Privilege granted, such as SELECT.

is_grantable

text

No

YES if the grantee can grant this privilege to other roles; NO otherwise.

SELECT grantee, source_name, relation_pattern, privilege_type
FROM information_schema.role_external_relation_grants
WHERE grantee = 'analyst';