Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>> Tom Lane wrote:
>>
>>> It might be worth pointing out that what I don't want pg_dump doing
>>> is suppressing "useless" parentheses. Adding whitespace ought to be
>>> safe enough. So if anyone wanted to do the work of decoupling those
>>> two effects of the prettyprint option, we could have "semi pretty
>>> printed" output in pg_dump. Dunno if it's worth it.
>>>
>
>
>> The attached patch goes part of the way towards doing this, by adding
>> white space unconditionally to the target list of a viewdef.
>>
> I'd rather do that than add another pg_get_viewdef variant or option.
> That's not what I had in mind by "decoupling" the option's effects.
>
>
>
Well, regardless of that it does what I want, and with a fairly small
amount of code.
I can make it work only in the pretty print case, if that's your objection.
Like you I doubt that fully decoupling pretty printing parentheses and
whitespace is going to be worth the trouble.
cheers
andrew