Re: How do I connect postgres table structures and view structures to an existing svn repository?

Lists: pgsql-general
From: "John Mitchell" <mitchelljj98(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: mitchelljj98(at)gmail(dot)com
Subject: How do I connect postgres table structures and view structures to an existing svn repository?
Date: 2007-08-01 14:03:23
Message-ID: fa2ac0580708010703pdd64029ld15381c199312cea@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

How do I connect postgres table structures and view structures to an
existing svn repository?

Thanks,

--
John J. Mitchell


From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: John Mitchell <mitchelljj98(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I connect postgres table structures and view structures to an existing svn repository?
Date: 2007-08-01 14:31:55
Message-ID: 46B0995B.7030404@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

John Mitchell schrieb:
> Hi,
>
> How do I connect postgres table structures and view structures to an
> existing svn repository?

Please elaborate: what do you mean with "connect"?
If you want to version control your DDL, people
use pgdump to create individual dumps (as sql
text files) and just add/commit them to the
repository.

Regards
Tino


From: "John Mitchell" <mitchelljj98(at)gmail(dot)com>
To: "Tino Wildenhain" <tino(at)wildenhain(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I connect postgres table structures and view structures to an existing svn repository?
Date: 2007-08-01 14:40:46
Message-ID: fa2ac0580708010740x5d16aef2obeee0e74491fb70e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

I am trying to store schema definitions in version-control which I can do by
saving the definition and then importing into svn, but I would like it
to be automatic , so that when an update occurs to a table or view within
postgres then that table or view is flagged within svn. This would be
similar to what I currently do with source code that I have for a web app
within eclipse.

On 8/1/07, Tino Wildenhain <tino(at)wildenhain(dot)de> wrote:
>
> John Mitchell schrieb:
> > Hi,
> >
> > How do I connect postgres table structures and view structures to an
> > existing svn repository?
>
> Please elaborate: what do you mean with "connect"?
> If you want to version control your DDL, people
> use pgdump to create individual dumps (as sql
> text files) and just add/commit them to the
> repository.
>
> Regards
> Tino
>

--
John J. Mitchell


From: Richard Huxton <dev(at)archonet(dot)com>
To: John Mitchell <mitchelljj98(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I connect postgres table structures and view structures to an existing svn repository?
Date: 2007-08-01 14:56:30
Message-ID: 46B09F1E.80904@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

John Mitchell wrote:
> I am trying to store schema definitions in version-control which I can do by
> saving the definition and then importing into svn, but I would like it
> to be automatic , so that when an update occurs to a table or view within
> postgres then that table or view is flagged within svn. This would be
> similar to what I currently do with source code that I have for a web app
> within eclipse.

Ah! I'm not aware of any such system.

You could write a small cron-script that dumped the schema once every 5
minutes so it could be picked up by svn.

I think most people have a separate collection of schema-creation/update
scripts that they keep under version control. All changes are then
through running these.

--
Richard Huxton
Archonet Ltd


From: Vivek Khera <vivek(at)khera(dot)org>
To: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I connect postgres table structures and view structures to an existing svn repository?
Date: 2007-08-07 15:54:29
Message-ID: 5B38900D-A6BF-412D-8AA3-CAB55040951A@khera.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


On Aug 1, 2007, at 10:56 AM, Richard Huxton wrote:

> You could write a small cron-script that dumped the schema once
> every 5 minutes so it could be picked up by svn.
>
> I think most people have a separate collection of schema-creation/
> update scripts that they keep under version control. All changes
> are then through running these.
>

You would have to do it via polling, since schema changes cause no
events to be generated (ie, you can't attach a trigger to a schema
change.)

But the *right* way is to make schema change scripts as "delta"
files, add them to your repo, test them on your staging environment,
then apply them to your production environment. That way you can
reconstruct your DB at any time and *know* it will work.