Re: pg_get_viewdefs() indentation considered harmful

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <stark(at)mit(dot)edu>, Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_get_viewdefs() indentation considered harmful
Date: 2014-05-03 13:44:34
Message-ID: 5364F2C2.4010404@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Krauss 2014-05-03 13:55:18 need of anonymous record
Previous Message Marko Tiikkaja 2014-05-03 13:17:38 Re: pg_get_viewdefs() indentation considered harmful