Re: pg_dump --split patch

From: Hannu Krosing <hannu(at)krosing(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Joel Jacobson <joel(at)gluefinance(dot)com>
Subject: Re: pg_dump --split patch
Date: 2011-01-04 09:58:43
Message-ID: 4D22EF53.30300@krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28.12.2010 17:00, Joel Jacobson wrote:
> Dear fellow hackers,
>
> Problem: A normal diff of two slightly different schema dump files
> (pg_dump -s), will not produce a user-friendly diff, as you get all
> changes in the same file.
>
Another Solution: I have used a python script for spliiting "dump -s"
output into a directory structure for years

A structure that seems to work well is

1. <database_name>.load.sql - file containing \i for all other files
2. tree of
schema1\
+- <objtype1>\
| + obj_of_type1_name1.sql
| + ...
+-<objtype2>\
...

That is, first have one directory per schema on top level and then one
for each type of objects
inside have one file per object.
Some things which may have non-unique names, like functions need extra
"uniquefication", like adding a underscore (or colon) separated list of
argument types at the end.

Most times you want to leave out the comment lines with OIDs so that
you can diff the files against another version

------------------------------------------
Hannu Krosing
http://www.2ndQuadrant.com/books/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2011-01-04 10:06:04 Re: pg_dump --split patch
Previous Message Greg Smith 2011-01-04 09:44:32 Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid