pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stef <svb@ucs.co.za>
Cc: Rod Taylor <rbt@rbt.ca>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Table versions
Date: 29 Oct 2003 12:45:35 -0500
Message-ID: <87wuaoey4g.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <3731.1067437850@sss.pgh.pa.us>
References: <20031029125752.35069e3b.svb@ucs.co.za>
	<1067435458.99917.34.camel@jester>
	<3731.1067437850@sss.pgh.pa.us>

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




view thread (7+ messages)  latest in thread

Message-ID: <87wuaoey4g.fsf@stark.dyndns.tv>
Permalink:  ../87wuaoey4g.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/87wuaoey4g.fsf@stark.dyndns.tv

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gsstark@mit.edu, tgl@sss.pgh.pa.us, svb@ucs.co.za, rbt@rbt.ca, pgsql-admin@postgresql.org
  Subject: Re: [SQL] Table versions
  In-Reply-To: <87wuaoey4g.fsf@stark.dyndns.tv>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox