Unix Technical Forum

How can I compare sql create script with running database?

This is a discussion on How can I compare sql create script with running database? within the Pgsql General forums, part of the PostgreSQL category; --> If I already have a running database, how can I compare the tables in the database with the sql ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-05-2008, 06:40 PM
=?UTF-8?Q?Bj=C3=B8rn?= T Johansen
 
Posts: n/a
Default How can I compare sql create script with running database?

If I already have a running database, how can I compare the tables in the database with the sql script to discover the differences?


Regards,

BTJ

--
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-05-2008, 06:40 PM
=?UTF-8?Q?Bj=C3=B8rn?= T Johansen
 
Posts: n/a
Default Re: How can I compare sql create script with runningdatabase?

On Thu, 05 Jun 2008 11:06:36 +0100
Raymond O'Donnell <rod@iol.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....

BTJ

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-05-2008, 06:40 PM
=?UTF-8?Q?Bj=C3=B8rn?= T Johansen
 
Posts: n/a
Default Re: How can I compare sql create script with runningdatabase?

On Thu, 05 Jun 2008 15:28:55 +0200
Tino Wildenhain <tino@wildenhain.de> wrote:

> Hi,
>
> Bjørn T Johansen wrote:
> > On Thu, 05 Jun 2008 11:06:36 +0100
> > Raymond O'Donnell <rod@iol.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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:37 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com