SHOW CREATE MATERIALIZED VIEW

SHOW CREATE MATERIALIZED VIEW returns the DDL statement used to create the materialized view.

Syntax

SHOW CREATE MATERIALIZED VIEW view_name
Field Use
view_name The materialized view you want to use. You can find available materialized view names through SHOW MATERIALIZED VIEWS.

Examples

SHOW CREATE MATERIALIZED VIEW winning_bids;
              name               |                                                                                                                       create_sql
---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 materialize.public.winning_bids | CREATE MATERIALIZED VIEW "materialize"."public"."winning_bids" IN CLUSTER "quickstart" AS SELECT * FROM "materialize"."public"."highest_bid_per_auction" WHERE "end_time" < "mz_catalog"."mz_now"()

Privileges

The privileges required to execute this statement are:

  • USAGE privileges on the schema containing the materialized view.
Back to top ↑