Re: pg_get_viewdefs() indentation considered harmful - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: pg_get_viewdefs() indentation considered harmful
Date
Msg-id 5364F2C2.4010404@dunslane.net
Whole thread Raw
In response to Re: pg_get_viewdefs() indentation considered harmful  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On 05/03/2014 09:17 AM, Marko Tiikkaja wrote:
> Hi all,
>
> Now that we're on the topic of view deparsing, what are your thoughts 
> on making this less painful?
>
> local:marko=#* create view foov as select exists(select * from foo);
> CREATE VIEW
> local:marko=#* \d+ foov
>                   View "public.foov"
>  Column |  Type   | Modifiers | Storage | Description
> --------+---------+-----------+---------+-------------
>  exists | boolean |           | plain   |
> View definition:
>  SELECT (EXISTS ( SELECT foo.way,
>             foo.too,
>             foo.many,
>             foo.columns,
>             foo.here
>            FROM foo)) AS "exists";
>
>
> I've switched to using SELECT 1 in EXISTS for this reason, but perhaps 
> other people haven't yet done that..
>
>
>


I've done that for quite a few years. I think it's better style than 
using *.

cheers

andrew




pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: pg_get_viewdefs() indentation considered harmful
Next
From: Peter Krauss
Date:
Subject: need of anonymous record