Balachandran Sivakumar <[email protected]> writes:
> Hi,
>
> I am using postgres 8.2. I would like to know if there is a
> way to get the definition of a 'view' by running a query.
>
> For eg., to get the list of views, we can do something like(of course,
> there are other ways)
>
> "SELECT table_name from infromation_schema.tables WHERE table_type = 'VIEW'"
>
> Can we do something similar to get the definition of the view ? The
> normal way of doing it is by running "\d+ view_name" in the postgres
> database prompt. Thanks
Is this what you are looking for?
SELECT definition FROM pg_views WHERE viewname like 'yourviewname' and
schemaname NOT IN ('pg_catalog', 'information_schema');
Thanks and Regards
Noorul
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc