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

Re: [ADMIN] Schema comparisons

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Mark Lubratt <mark(dot)lubratt(at)indeq(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [ADMIN] Schema comparisons
Date: 2004-02-28 17:59:50
Message-ID: 200402281759.50389.dev@archonet.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-hackers
On Saturday 28 February 2004 15:39, Tom Lane wrote:
> Mark Lubratt <mark(dot)lubratt(at)indeq(dot)com> writes:
> > On Feb 27, 2004, at 10:28 PM, Tom Lane wrote:
> >> Mark Lubratt <mark(dot)lubratt(at)indeq(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Rob FieldingDate: 2004-02-28 18:40:12
Subject: WAL Optimisation - configuration and usage
Previous:From: Michael BrusserDate: 2004-02-28 17:58:26
Subject: Re: [ADMIN] Schema comparisons

pgsql-admin by date

Next:From: Gavin M. RoyDate: 2004-02-29 00:33:38
Subject: Re: [HACKERS] Any Gentoo users interested in a slotted PostgreSQL
Previous:From: Michael BrusserDate: 2004-02-28 17:58:26
Subject: Re: [ADMIN] Schema comparisons

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