Re: reprise: pretty print viewdefs

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reprise: pretty print viewdefs
Date: 2011-12-22 17:18:54
Message-ID: CA+TgmoYvALGv_JWRcRwmoYZcWqzjdOC9=AqroGwreP99-oE72A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-12-22 17:52:24 Re: reprise: pretty print viewdefs
Previous Message Tom Lane 2011-12-22 17:17:36 Indexes with duplicate columns