Monday, September 26, 2011

Postgresql - Getting the sql behind a view

If you need to take a glance of the sql query that created a view, you can obtain that information from the pg_views catalog. The catalog's structure is pretty much self explanatory.

http://www.postgresql.org/docs/9.0/interactive/view-pg-views.html

as you can see, the query is contained in the definition field which is of type text.

No comments:

Post a Comment