Re: reprise: pretty print viewdefs - Mailing list pgsql-hackers

From Robert Haas
Subject Re: reprise: pretty print viewdefs
Date
Msg-id CA+TgmoYvALGv_JWRcRwmoYZcWqzjdOC9=AqroGwreP99-oE72A@mail.gmail.com
Whole thread Raw
In response to reprise: pretty print viewdefs  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: reprise: pretty print viewdefs  (Andrew Dunstan <andrew@dunslane.net>)
Re: reprise: pretty print viewdefs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> The simple solution I originally proposed to put a line feed and some space
> before every target field in pretty print mode. This is a two line patch.
> The downsides are a) maybe not everyone will like the change and b) it will
> produce superfluous newlines, e.g. before CASE expressions.

With regard to (a), specifically, you won't like this change if your
column names are things like "bob" and "sam", because you'll burn
through an inordinate amount of vertical space.  On the other hand, I
agree that you'll probably find it a big improvement if they are
things like "nc.nspname::information_schema.sql_identifier as
udt_schema".

It has always seemed to me that a sensible strategy here would be to
try to produce output that looks good in 80 columns, on the assumption
that (1) everyone has at least that much horizontal space to play with
and (2) people who do won't necessarily mind it if we don't use all of
that horizontal space when pretty-printing SQL.

However, it is possible that I am living in the dark ages.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Indexes with duplicate columns
Next
From: Andrew Dunstan
Date:
Subject: Re: reprise: pretty print viewdefs