How to see the CREATE VIEW code for a view in PostgreSQL?

前端 未结 6 612
我寻月下人不归
我寻月下人不归 2020-12-12 13:59

Is there an easy way to see the code used to create a view using the PostgreSQL command-line client?

Something like the SHOW CREATE VIEW from MySQL.

6条回答
  •  一整个雨季
    2020-12-12 14:34

    select pg_get_viewdef('viewname', true)
    

    A list of all those functions is available in the manual:

    http://www.postgresql.org/docs/current/static/functions-info.html

提交回复
热议问题