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

pg_dump --pretty-print-views

From: Marko Tiikkaja <pgmail(at)joh(dot)to>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump --pretty-print-views
Date: 2013-01-10 12:23:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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

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.

Marko Tiikkaja

Attachment: pretty_print_views.patch
Description: text/plain (3.6 KB)


pgsql-hackers by date

Next:From: Amit kapilaDate: 2013-01-10 12:38:37
Subject: Re: Extra XLOG in Checkpoint for StandbySnapshot
Previous:From: Andres FreundDate: 2013-01-10 09:55:20
Subject: Re: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)

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