来自对pg_views的查询的不完整信息 [英] incomplete information from query on 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屋!