Re: Question - help needed - Mailing list pgsql-novice

From J. Roeleveld
Subject Re: Question - help needed
Date
Msg-id 201011091856.05731.joost@antarean.org
Whole thread Raw
In response to Question - help needed  (Dragan Keselj <dragan.keselj@gmail.com>)
Responses Re: Question - help needed  (Jayadevan M <Jayadevan.Maymala@ibsplc.com>)
Re: Question - help needed  (Oliver Charles <oliver@ocharles.org.uk>)
List pgsql-novice
On Tuesday 09 November 2010 18:18:23 Dragan Keselj wrote:
> Hello,
>
> I have 2 identical databases. One is with data and second one is empty (for
> designing).
> Is it possible to make changes on empty database (for example to add,
> remove column or change name...) and, with these changes, refresh design
> of second one database (without data changes)?
>
> thnx for help

Hi,

Simple answer: yes and no...

More usefull answer:
If you make changes to the empty database using "ALTER TABLE" commands, you
should be able to use those same commands on the actual database.

But, if you delete a table/column/... that actually contains data, you WILL
loose that data.

If you redesign using DROP TABLE / CREATE TABLE commands, you will need to find
a tool that can compare 2 states of the database and create the ALTER TABLE
commands for you.

Same goes for other database objects, like VIEWs, INDEXes,....., etc.

--
Joost

PS. I'm not familiar with a free tool that can help with this, but that does
not mean there is no free tool.

pgsql-novice by date:

Previous
From: Dragan Keselj
Date:
Subject: Question - help needed
Next
From: Jayadevan M
Date:
Subject: Re: Question - help needed