Re: How can I compare sql create script with running database?

From: Bjørn T Johansen <btj(at)havleik(dot)no>
To: Tino Wildenhain <tino(at)wildenhain(dot)de>
Cc: rod(at)iol(dot)ie, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I compare sql create script with running database?
Date: 2008-06-05 16:02:36
Message-ID: 20080605180236.00e6de87@pennywise.havleik.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 05 Jun 2008 15:28:55 +0200
Tino Wildenhain <tino(at)wildenhain(dot)de> wrote:

> Hi,
>
> Bjørn T Johansen wrote:
> > On Thu, 05 Jun 2008 11:06:36 +0100
> > Raymond O'Donnell <rod(at)iol(dot)ie> wrote:
> >
> >> On 05/06/2008 10:52, Bjørn T Johansen wrote:
> >>> If I already have a running database, how can I compare the tables in
> >>> the database with the sql script to discover the differences?
> >> You can use pg_dump with the -s option to dump the schema of the
> >> database, and run it through the diff tool of your choice.
> >>
> >> Ray.
> >>
> >
> > Well, not really an option because I don't think the dump will be an exact match to the sql script....
> >
>
> Unless you create all your objects with your script into a different
> Database on the server then use pg_dump -s on both and compare the
> result :-)
>
> Cheers
> Tino
>

That I could do.... :)

BTJ

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2008-06-05 16:21:26 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Collin Peters 2008-06-05 15:47:33 pgAdmin complains about vacuuming required after fresh 8.1 install