Re: pretty print viewdefs - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: pretty print viewdefs
Date
Msg-id 4A96B4BF.90309@dunslane.net
Whole thread Raw
In response to Re: pretty print viewdefs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pretty print viewdefs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pretty print viewdefs
Next
From: Tom Lane
Date:
Subject: Re: 8.5 release timetable, again