Skip to main content

SHOW CREATE VIEW

Use the SHOW CREATE VIEW command to see what query was used to create the specified view.

Syntax

SHOW CREATE VIEW view_name;

Parameters

ParameterDescription
view_nameThe view to show the query of.

Example

CREATE VIEW v1 AS SELECT id FROM taxi_trips;
SHOW CREATE VIEW v1;

Here is the result.

   Name    |                 Create Sql                  
-----------+---------------------------------------------
public.v1 | CREATE VIEW v1 AS SELECT id FROM taxi_trips
(1 row)

SHOW CREATE MATERIALIZED VIEW

SHOW CREATE TABLE

Ask AI

Help us make this doc better!

Was this page helpful?

Happy React is loading...