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