pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Buttafuoco <jim@contactbda.com>
To: Stef <svb@ucs.co.za>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: [ADMIN] Postgres schema comparison.
Date: Mon, 7 Mar 2005 11:14:09 -0500
Message-ID: <20050307160942.M57950@contactbda.com> (raw)
In-Reply-To: <20050307173155.285dc2eb@svb.ucs.co.za>
References: <20050307113312.2200b65c@svb.ucs.co.za>
	<422C42B7.1030509@logix-tt.com>
	<20050307145444.459e54fe@svb.ucs.co.za>
	<22961.1110205853@sss.pgh.pa.us>
	<20050307173155.285dc2eb@svb.ucs.co.za>


Stef,

I use dblink to attach to both databases and query pg_namespace, pg_class, pg_attribute ... to get the diffs.  See
attached as an example.  look for the dblink_connect lines to specify your database.  You will need to install
contrib/dblink.  I used this with 7.4.X series and have NOT tested yet with 8.0.X.

You can adjust the output to fit your needs. 

Jim


---------- Original Message -----------
From: Stef <svb@ucs.co.za>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-ADMIN@postgresql.org, pgsql-sql@postgresql.org
Sent: Mon, 7 Mar 2005 17:31:55 +0200
Subject: Re: [ADMIN] [SQL] Postgres schema comparison.

> Tom Lane mentioned :
> => > The problem I have with this, is that I have to run the command per table,
> => 
> => Why?
> => 
> => If the problem is varying order of table declarations, try 8.0's
> => pg_dump.
> 
> Yes, this will solve the global schema check, but I will still need to split
> it into "per table" dumps , to do "per table" comparisons.
> 
> Kind Regards
> Stefan
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
------- End of Original Message -------

Attachments:

  db_compare.sql (application/octet-stream, 9.8K) download

view thread (19+ messages)  latest in thread

Message-ID: <20050307160942.M57950@contactbda.com>
Permalink:  ../20050307160942.M57950@contactbda.com/
Also on:    postgresql.org/message-id/20050307160942.M57950@contactbda.com

 · 

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: jim@contactbda.com, svb@ucs.co.za, tgl@sss.pgh.pa.us
  Subject: Re: [ADMIN] Postgres schema comparison.
  In-Reply-To: <20050307160942.M57950@contactbda.com>

* 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