X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 7D0E111F8CC8 for ; Thu, 20 Apr 2006 05:54:54 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.204 X-Spam-Level: X-Spam-Status: No, score=-2.204 required=5 tests=[AWL=0.397, BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 91pDqsqWE5dL for ; Thu, 20 Apr 2006 05:54:46 -0300 (ADT) X-Greylist: delayed 14:27:42.670625 by SQLgrey- Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 434F911F8CBF for ; Thu, 20 Apr 2006 05:54:42 -0300 (ADT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 5CB2DB918BD; Thu, 20 Apr 2006 10:54:42 +0200 (CEST) Message-ID: <44474C51.5010208@andromeiberica.com> Date: Thu, 20 Apr 2006 10:54:41 +0200 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Schema synchronization References: <444680F0.5000809@andromeiberica.com> <2237D1DC-525A-4571-9F16-BC4E54D847D8@pgedit.com> In-Reply-To: <2237D1DC-525A-4571-9F16-BC4E54D847D8@pgedit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/197 X-Sequence-Number: 21366 John DeSoi wrote: > > On Apr 19, 2006, at 2:26 PM, Arnau wrote: > >> I have several databases that I have to synchronize their schemas. >> I have been testing several programs like EMS PostgreSQL Comparer and >> Navicat PostgreSQL but none of them does all I need. Any advise about >> what is the best way to sync the schemas? > > > I think the best way is to do proper version control on files. After > initial version 1, create version 2 as a series of create table, alter > table, etc, statements to convert version 1 to version 2 and so on. > Changing databases independently with your favorite admin tool and then > trying to sync them up based on schema differences is difficult. For > example, I don't think there is a way for a comparison program to know > the difference between renaming a column and dropping a column with the > addition a new one of the same type. The semantics of these two > operations are very different. I know that should be the way to go, but this wasn't done in the past. Since now on we have a version control system. Now I have some DDBB to synchronize so I need to do something to solve the current situation. Thanks -- Arnau