Re: pg_views.definition

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_views.definition
Date: 2002-07-16 06:51:41
Message-ID: GNELIHDDFBOCMGBFGEFOCECOCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> We actually reverse it on the fly:
>
> test=> \d xx
> View "xx"
> Column | Type | Modifiers
> ---------+------+-----------
> relname | name |
> View definition: SELECT pg_class.relname FROM pg_class;

Well, no - that's just dumping out the parsed form.

eg.

test=# create view v as select 1 in (1,2,3,4);
CREATE
test=# select * from v;
?column?
----------
t
(1 row)

test=# \d v
View "v"
Column | Type | Modifiers
----------+---------+-----------
?column? | boolean |
View definition: SELECT ((((1 = 1) OR (1 = 2)) OR (1 = 3)) OR (1 = 4));

It's really annoying when people save their view definition in phpPgAdmin
and when they load it up again it's lost all formatting. Functions and
rules, for instance keep the original formatting somewhere.

Chris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luis Alberto Amigo Navarro 2002-07-16 08:51:03 Re: [HACKERS] please help on query
Previous Message Tom Lane 2002-07-16 06:44:25 Re: Unused system table columns