Skip site navigation (1) Skip section navigation (2)

Re: pg_dump --pretty-print-views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <pgmail(at)joh(dot)to>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump --pretty-print-views
Date: 2013-01-10 16:21:13
Message-ID: 7076.1357834873@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Marko Tiikkaja <pgmail(at)joh(dot)to> writes:
> While we can do the actual splitting of objects from a -Fc dump 
> relatively easily, we can't fix the view definitions after they've been 
> dumped.  So I'm proposing a --pretty-print-views setting to pg_dump 
> (patch attached).

-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?)

I don't think we should offer a foot-gun option like this at all,
and as for making it the default, not bloody likely.

I think your schema-diffing needs would be better served by a tool
specifically directed at that problem; which pg_dump is not, but
I believe there are some out there.

			regards, tom lane


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2013-01-10 16:32:35
Subject: Re: PL/perl should fail on configure, not make
Previous:From: Dimitri FontaineDate: 2013-01-10 16:14:28
Subject: Re: in-catalog Extension Scripts and Control parameters (templates?)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group