Re: Migration of db - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Migration of db
Date
Msg-id dcc563d10912311322k35b0752i1aeb3b8a0428ecef@mail.gmail.com
Whole thread Raw
In response to Migration of db  (akp geek <akpgeek@gmail.com>)
List pgsql-general
On Thu, Dec 31, 2009 at 1:45 PM, akp geek <akpgeek@gmail.com> wrote:
> Hi All -
>           We have 2 databases test and prod. Now they are out of sync ( of
> course they will be to some extent ). But there are some functions in some
> schemas. we have to sync from prod to test. What I wanted to ask, is there
> any tool that you recommend for version control. Because we are having tough
> time tracking the changes

I've used the poor man's version control in the past.  Make a table:

create table version_control(id numeric primary key, description text,
applied timestamp default now());

And then in every bit of DDL you submit to the DB, you put a single
line at the top to insert the proper values to identify it.  Then you
can just compare the various dbs' version_control tables to see what's
missing etc.  Assuming you don't let tom, dick, harry and all their
friends run ddl on the prod / staging / qa databases and pay attention
to what you're doing it should work well.

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Migration of db
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Query very slow when in plpgsql function