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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to