Re: [ADMIN] Schema comparisons - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: [ADMIN] Schema comparisons
Date
Msg-id 200402281759.50389.dev@archonet.com
Whole thread Raw
In response to Re: [ADMIN] Schema comparisons  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [ADMIN] Schema comparisons
List pgsql-hackers
On Saturday 28 February 2004 15:39, Tom Lane wrote:
> Mark Lubratt <mark.lubratt@indeq.com> writes:
> > On Feb 27, 2004, at 10:28 PM, Tom Lane wrote:
> >> Mark Lubratt <mark.lubratt@indeq.com> writes:
> >>> I've been trying to be careful, but I've gotten out of synch with
> >>> whether or not I've applied the changes I've made to the development
> >>> system to the production system.  Is there a utility that will compare
> >>> the tables, functions, trigger, views, etc. between two systems and
> >>> flag the schema elements that aren't in synch between the two?
> >>
> >> Have you tried diffing pg_dump output?  It's not the greatest tool but
> >> it's helpful.

> Comments?  Anyone see a reason not to do this?

It would help me out too - I have similar problems to Mark with keeping 
various copies in sync.

I've been looking at storing $REVISION$ in comments for each object, so my 
install scripts can halt if there is a problem. Not wanting to use my only 
comment slot for this I was thinking about an extension to the COMMENT ON 
statement:
COMMENT ON TABLE foo IS 'This is where I stroe my foos.';
COMMENT ON TABLE foo SECTION 'default' IS 'I meant store my foos.';
COMMENT ON TABLE foo SECTION 'revision' IS '1.19';
COMMENT ON TABLE foo SECTION 'bar' IS 'baz';

From first inspections, it seems to be a matter of adding a column to a 
base-table and changing some queries/use a view+base-table. I thought it 
might be of use to the pgadmin crew etc, but haven't got to the point of 
writing up my notes and seeing if there is interest.

Is there any point in thinking this through further, or is it me not thinking 
clearly?

--  Richard Huxton Archonet Ltd


pgsql-hackers by date:

Previous
From: Michael Brusser
Date:
Subject: Re: [ADMIN] Schema comparisons
Next
From: "Ramanujam H S Iyengar"
Date:
Subject: How to get Relation name from Oid ??