来自 pg_views 查询的不完整信息 [英] incomplete information from query on pg_views

查看:20
本文介绍了来自 pg_views 查询的不完整信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有一个视图 (PostgreSQL),我想查看它的代码.

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

我写了这个查询:

select definition from pg_views where viewname='x'

这在大多数情况下都有效,但是在某些视图中,当 select 代码很长时,我会在某些时候 (...)

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?

推荐答案

您想要 pg_get_viewdef,但我怀疑您会遇到同样的问题.问题可能在于客户端应用程序正在截断返回的查询.

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.

如果您使用的是 PgAdmin-III 这在常见问题解答中.

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

如果您使用的是 psql 这不应该发生.

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

这篇关于来自 pg_views 查询的不完整信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆