incomplete information from query on pg_views [duplicate]

时光毁灭记忆、已成空白 提交于 2019-12-17 06:56:15

问题


I have a view in my database (PostgreSQL) and I would like to see it's code.

I wrote this query:

select definition from pg_views where viewname='x'

this works most of the time, However in some of the views when the select code is long I get at some point (...)

for example this is one of the results of query where it shows (...):

" SELECT f.selectid,
    a.clientid,
    a.orderid,
    a.clientname,
    c.part,
    c.product,
    c.okey,
    e.contry,
    d.city,
    (
        CASE
            WHEN (b.dateofissue IS NULL) THEN
            CASE
       (...)"

This is only part of the code... Why it doesn't show me the whole code?


回答1:


You want pg_get_viewdef, but I suspect you'll have the same issue there. The problem is probably that the client application is truncating the returned query.

If you're using PgAdmin-III this is in the FAQ.

If you're using psql this shouldn't happen.




回答2:


In pgAdmin III, under Query tool options:

pgAdmin Query tool Options



来源:https://stackoverflow.com/questions/31828182/incomplete-information-from-query-on-pg-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!