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/