Re: Table versions - Mailing list pgsql-sql

From Greg Stark
Subject Re: Table versions
Date
Msg-id 87wuaoey4g.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: Table versions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Table versions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Returning to the original problem, it seems to me that comparing "pg_dump
> -s" output is a reasonable way to proceed.

I've actually started checking in a pg_dump -s output file into my CVS tree.

However I prune a few key lines from it. I prune the TOC OID numbers from it,
and anything not owned by the user I'm interested in.

The makefile rule I use looks like:

schema.sql:
    pg_dump -U postgres -s user | sed '/^-- TOC entry/d;/^\\connect - postgres/,/^\\connect - user/d;/^SET
search_path/d;/^$$/d;/^--$$/d'> $@ 


This still suffers from one major deficiency. The order that objects are
outputed isn't necessarily consistent between databases. If I add tables to
the development server but then add them to the production server in a
different order the schema still shows differences even though the objects in
the two databases are identical.

--
greg

pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Help on update that subselects other records in table, uses joins
Next
From: Tom Lane
Date:
Subject: Re: Table versions