Re: pg_dump --split patch - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: pg_dump --split patch
Date
Msg-id 4D22EF53.30300@krosing.net
Whole thread Raw
In response to pg_dump --split patch  (Joel Jacobson <joel@gluefinance.com>)
List 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/


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: pg_dump --split patch
Next
From: Greg Smith
Date:
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid