Use the SHOW CREATE VIEW
command to see what query was used to create the specified view.
SHOW CREATE VIEW view_name;
Parameter | Description |
---|---|
view_name | The view to show the query of. |
CREATE VIEW v1 AS SELECT id FROM taxi_trips;
SHOW CREATE VIEW v1;
Name | Create Sql
-----------+---------------------------------------------
public.v1 | CREATE VIEW v1 AS SELECT id FROM taxi_trips
(1 row)
Was this page helpful?