Re: pg_dump --pretty-print-views

From: David Fetter <david(at)fetter(dot)org>
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 13:25:33
Message-ID: 20130110132533.GF2474@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 10, 2013 at 01:23:10PM +0100, Marko Tiikkaja wrote:
> Hi,
>
> At the company I work for, we've been splitting dumps into separate
> files and diffing them for a while now. By far the biggest problem
> we had was with views: pg_dump by default dumps views on one line,
> in a format which maximizes compatibility. Now this has several
> problems for our use case:
>
> 1) The one-line equivalent of a 200-line view is completely impossible
> to read.
> 2) If there's a difference between the two dumped view definitions,
> it takes a long time to find where and what exactly it is.
> 3) For some reason some expressions are dumped differently depending
> on how exactly they are written, cluttering the diff with false
> positives.
>
> 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).
>
> Any feedback is welcome.

Why not make this the new default? That way, new users will have the
benefit, and people with tools or processes that depend on the old
behavior can still have it.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-01-10 13:59:14 Re: Index build temp files
Previous Message Amit kapila 2013-01-10 12:38:37 Re: Extra XLOG in Checkpoint for StandbySnapshot