Skip to main content

Overview

SHOW commands provide a convenient way to inspect database objects, their properties, and metadata in Materialize. These commands are similar to PostgreSQL’s \d commands but work in any SQL client.

Available SHOW Commands

SHOW CLUSTERS

List all clusters

SHOW CLUSTER REPLICAS

List replicas for clusters

SHOW SOURCES

List all sources

SHOW SUBSOURCES

List subsources for a source

SHOW MATERIALIZED VIEWS

List all materialized views

SHOW VIEWS

List all regular views

SHOW INDEXES

List all indexes

SHOW SINKS

List all sinks

SHOW TABLES

List all tables

SHOW COLUMNS

Show columns for a table or view

SHOW CONNECTIONS

List all connections

SHOW SECRETS

List all secrets

SHOW DATABASES

List all databases

SHOW SCHEMAS

List all schemas

SHOW ROLES

List all roles

SHOW CREATE

Show the DDL for creating an object

Common Patterns

List All Objects of a Type

-- Show all materialized views
SHOW MATERIALIZED VIEWS;

-- Show all sources
SHOW SOURCES;

-- Show all clusters
SHOW CLUSTERS;

Filter by Schema

-- Show views in a specific schema
SHOW VIEWS FROM my_schema;

-- Show tables in a specific database and schema
SHOW TABLES FROM my_database.my_schema;

Pattern Matching

-- Show views matching a pattern
SHOW VIEWS LIKE 'order%';

-- Show sources in a schema matching a pattern
SHOW SOURCES FROM my_schema LIKE '%kafka%';

Inspect Object Structure

-- Show columns of a table
SHOW COLUMNS FROM orders;

-- Show the SQL used to create a view
SHOW CREATE VIEW my_view;

-- Show indexes on a specific object
SHOW INDEXES ON orders;

Discovery Workflow

1

List databases and schemas

Start by exploring the available databases and schemas:
SHOW DATABASES;
SHOW SCHEMAS FROM my_database;
2

Find objects in a schema

List all objects in a schema:
SHOW SOURCES FROM my_schema;
SHOW MATERIALIZED VIEWS FROM my_schema;
SHOW TABLES FROM my_schema;
3

Inspect object details

Get detailed information about specific objects:
SHOW COLUMNS FROM my_schema.orders;
SHOW CREATE MATERIALIZED VIEW my_schema.revenue_by_region;
4

Check cluster assignments

See which cluster objects are running on:
SHOW CLUSTERS;
SHOW CLUSTER REPLICAS;

Examples by Use Case

Debugging Data Pipelines

-- Show all sources and their status
SHOW SOURCES;

-- Check subsources for a PostgreSQL source
SHOW SUBSOURCES FROM pg_source;

-- Verify materialized views exist
SHOW MATERIALIZED VIEWS LIKE 'orders%';

-- Check if indexes are defined
SHOW INDEXES ON order_totals;

Resource Management

-- List all clusters and their replicas
SHOW CLUSTERS;
SHOW CLUSTER REPLICAS;

-- Find objects on a specific cluster
SELECT name, type FROM mz_catalog.mz_objects
WHERE cluster_id = (
    SELECT id FROM mz_catalog.mz_clusters WHERE name = 'my_cluster'
);

Security Auditing

-- List all roles
SHOW ROLES;

-- Show role membership
SHOW ROLE MEMBERSHIP;

-- List secrets (names only, not values)
SHOW SECRETS;

-- Show connections
SHOW CONNECTIONS;

SHOW CREATE Commands

Get the DDL for recreating objects:
-- Show CREATE for different object types
SHOW CREATE VIEW my_view;
SHOW CREATE MATERIALIZED VIEW my_mv;
SHOW CREATE SOURCE my_source;
SHOW CREATE SINK my_sink;
SHOW CREATE TABLE my_table;
SHOW CREATE INDEX my_index;
SHOW CREATE is useful for backing up object definitions or understanding how an object was created.

Output Format

Most SHOW commands return results as tables:
SHOW CLUSTERS;
     name     | replicas
--------------+----------
 quickstart   | 1
 ingest       | 2
 compute      | 3

SHOW vs System Catalog

SHOW commands are convenient shortcuts, but for programmatic access or complex queries, use the system catalog:
SHOW MATERIALIZED VIEWS;
Simple and concise for interactive use.

System Catalog

Query detailed metadata programmatically

Monitoring

Monitor Materialize health and performance

CREATE Commands

Create new database objects

ALTER Commands

Modify existing database objects

Build docs developers (and LLMs) love