Re: pretty print viewdefs - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: pretty print viewdefs
Date
Msg-id 4A956376.4050106@pse-consulting.de
Whole thread Raw
In response to Re: pretty print viewdefs  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: pretty print viewdefs  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Andrew Dunstan wrote:
>
>
>> 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.
>>   
>
>
> To do that we would need to keep track of how much space was used on
> the line and how much space what we were adding would use. It's
> doable, but it's a lot more work.

When initially implementing the pretty option, I ran into the same
consideration. Back then, I decided not to try any line breaking on the
column list. Instead, I treated the columns as "just a bunch of
columns", laying the emphasis on the from-clause (with potentially many
joined tables).
So a pretty column formatting should still be white-space saving.

Regards,
Andreas


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: 8.5 release timetable, again
Next
From: Tom Lane
Date:
Subject: Re: 8.5 release timetable, again