Re: [SQL] Table versions

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stef <svb(at)ucs(dot)co(dot)za>, Rod Taylor <rbt(at)rbt(dot)ca>, pgsql-admin(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Table versions
Date: 2003-10-29 17:45:35
Message-ID: 87wuaoey4g.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-10-29 17:49:40 Re: [SQL] Table versions
Previous Message Tom Lane 2003-10-29 17:24:33 Re: pg_clog & vacuum oddness

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-10-29 17:49:40 Re: [SQL] Table versions
Previous Message Josh Berkus 2003-10-29 17:42:57 Re: Help on update that subselects other records in table, uses joins