2009/8/26 Andrew Dunstan <andrew@dunslane.net>:
>
> [originally sent from wrong account :-( ]
>
>
> The tiny patch attached fixes a long-standing peeve of mine (and at least
> one of my clients'), namely that the target list printed in viewdefs are
> unreadable.
>
> example output now looks like this:
>
> regression=# select pg_get_viewdef('shoe',true);
> pg_get_viewdef
> -----------------------------------------------
> SELECT
> sh.shoename,
> sh.sh_avail,
> sh.slcolor,
> sh.slminlen,
> sh.slminlen * un.un_fact AS slminlen_cm,
> sh.slmaxlen,
> sh.slmaxlen * un.un_fact AS slmaxlen_cm,
> sh.slunit
> FROM shoe_data sh, unit un
> WHERE sh.slunit = un.un_name;
>
>
I am not sure - this should by task for client application. But Pg
should have some pretty print function - it is easy implemented there.
Personally, I prefere Celko's notation, it is little bit more compact
SELECT sh.shoename, sh.sh_avail, sh.slcolor, sh.slminlen, sh.slminlen * un.un_fact AS slminlen_cm,
sh.slmaxlen, sh.slmaxlen * un.un_fact AS slmaxlen_cm, sh.slunit FROM shoe_data sh, unit un WHERE sh.slunit
=un.un_name;
but, sure - this is my personal preference.
> Is there any objection?
I thing so default should be unformated with some pretty printing support.
regards
Pavel Stehule
>
> cheers
>
> andrew
>
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>