Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-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

pgsql-admin by date

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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group