Re: View definition truncated in information_schema - Mailing list pgsql-general

From Michael Fuhr
Subject Re: View definition truncated in information_schema
Date
Msg-id 20050127192800.GA46368@winnie.fuhr.org
Whole thread Raw
In response to View definition truncated in information_schema  (Eric E <whalesuit@bonbon.net>)
List pgsql-general
On Thu, Jan 27, 2005 at 12:09:47PM -0500, Eric E wrote:

>    I'm trying to retrieve the SQL definition of a view from
> information_schema via:
> SELECT view_definition FROM information_schema.views WHERE
> table_name = 'viewname';
>    It appears the definition returned is truncated at a fixed number of
> characters - for this view it's 7650.

What client are you using?  psql, or something else?  In simple
tests I don't see this truncation with psql (8.0.0); I wonder
if your client is truncating the output.

> Does anybody know where this problem is in information_schema, or in the
> actual storage of the text definition.  If it's the former, is there a
> way I can query the text definition directly?

information_schema.views is itself a view; you can see its definition
by executing the following in psql:

\d information_schema.views

The above shows that the view_definition column gets its value from
pg_get_viewdef().  What do the following queries return?

SELECT length(pg_get_viewdef('viewname'::regclass));
SELECT pg_get_viewdef('viewname'::regclass);

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] My postmaster just crashed !
Next
From: David Fetter
Date:
Subject: Re: convert mdb files to pg?