Re: pg_dump --pretty-print-views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump --pretty-print-views
Date: 2013-01-10 17:09:15
Message-ID: 8211.1357837755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> On Thu, Jan 10, 2013 at 11:21:13AM -0500, Tom Lane wrote:
>> -1. The reason that pg_dump does not pretty-print things is that
>> it's unsafe; there is no real guarantee that the view will reload as
>> intended, because it's under-parenthesized. (Even if we were sure
>> it would reload safely into current code, which I'm not, what of
>> future versions that could have different operator precedences?)

> Under what circumstances do pretty-printed views not reload? It seems
> to me that such circumstances would be pretty_print() bugs by
> definition.

It would not be a bug, particularly not in the case of a subsequent
release with different operator precedence. pg_dump's charter is to be
safe. Pretty-printing's charter is to look nice. These goals are not
compatible. If they were, we'd never have made a separate pretty
printing mode at all.

Now, we could consider changing the "safe" mode so that it tries to
provide nice whitespace/line breaks while not risking removal of
parentheses. But that would be a totally different patch, and I'm
not sure how much it would address Marko's desires anyway.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-01-10 17:26:06 Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers
Previous Message Rod Taylor 2013-01-10 17:08:45 GIN over array of ENUMs