Re: pretty print viewdefs

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, decibel <decibel(at)decibel(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pretty print viewdefs
Date: 2009-08-27 16:30:55
Message-ID: 4A96B4BF.90309@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> OK, drawing this together, what I did was to go back closer to my
>> original idea, but put this in a separate function, so nobody would get
>> too upset ;-)
>>
>
> This seems seriously ugly. Why don't you have the flag just driving
> your original two-line addition?
>
>
>

I am confused.

The original two line addition was already in effect driven by the
PRETTY_INDENT flag, because the appendContextKeyword call would be
effectively a no-op if that flag wasn't on. But apparently some people
don't want each column on a separate line, as I do, even when it's
pretty printed, so, since that's what I want, I provided for it in a
separate function, but I made the code take account of the cases you and
Greg mentioned, where it already begins a new line for the column def.

So, what exactly is ugly? My code? I can believe that. I have since made
it slightly simpler by using a pstrdup'ed string instead of an extra
StringInfo object. The output? That's a matter of taste, but I don't see
how it's less ugly than what's there now. The idea of a new function? I
don't see how to get what I want without it unless we're prepared to
upset some of the people who have objected to my proposal.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2009-08-27 16:35:49 Re: MySQL Compatibility WAS: 8.5 release timetable, again
Previous Message Tom Lane 2009-08-27 16:29:03 Re: 8.5 release timetable, again