I'm working in Postgres 9.4. Is there any way I can see the query that was used to create a materialized view?
Doing:
# \d my_view;
just shows me the column names and indexes of the view, not the command used to create it. And I can't see anything in the docs about this.
Thanks for your help.
select pg_get_viewdef('my_view')? (Haven't tested it on a matview)\d+ my_viewalthough it may abbreviate it. I haven't tried in 9.4.