SHOW VIEW - Amazon Redshift

SHOW VIEW

Shows the definition of a view, including for materialized views and late-binding views. You can use the output of the SHOW VIEW statement to recreate the view.

Syntax

SHOW VIEW [schema_name.]view_name

Parameters

schema_name

(Optional) The name of the related schema.

view_name

The name of the view to show.

Examples

Following is the view definition for the view LA_Venues_v.

create view LA_Venues_v as select * from venue where venuecity='Los Angeles';

Following is an example of the SHOW VIEW command and output for the view defined preceding.

show view LA_Venues_v;
SELECT venue.venueid, venue.venuename, venue.venuecity, venue.venuestate, venue.venueseats FROM venue WHERE ((venue.venuecity)::text = 'Los Angeles'::text);

Following is the view definition for the view public.Sports_v in the schema public.

create view public.Sports_v as select * from category where catgroup='Sports';

Following is an example of the SHOW VIEW command and output for the view defined preceding.

show view public.Sports_v;
SELECT category.catid, category.catgroup, category.catname, category.catdesc FROM category WHERE ((category.catgroup)::text = 'Sports'::text);