Re: SVN event hooks for PL/PGSQL functions and DDL?

From: "Webb Sprague" <webb(dot)sprague(at)gmail(dot)com>
To: "Blazej Oleszkiewicz" <bl(dot)oleszkiewicz(at)gmail(dot)com>, "General postgres mailing list" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SVN event hooks for PL/PGSQL functions and DDL?
Date: 2008-01-18 18:51:33
Message-ID: b11ea23c0801181051o6925c545pf053a8230afe748e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't mean to be thick headed, but ...

On Jan 18, 2008 1:11 AM, Blazej Oleszkiewicz <bl(dot)oleszkiewicz(at)gmail(dot)com> wrote:
> Its simple.

... it seems not so simple, as

(1) SVN docs say don't modify the repository before a commit,

(2) I would think that I would need to call pg_dump BEFORE the commit
in order to get a diff on the function code if appropriate, playing
hell with (1) above. If the version control doesn't track my on the
fly changes to the functions, this little project is all for naught.

I will start experimenting today, but I would love any random thoughts
on this topic.

-W

> Create runable script "post-commit" in
> <svn_repo>/hooks
>
> script body may look like
>
> == begin ==
> #! /bin/sh
> pg_dump [option...] [dbname] > /path/to/db/backups/$2.dump
> == end ==
>
> "$1" is REPOS
> "$2" is REVISION
>
>
> It works as follows
> When you make commit on SVN it runs the hook script which makes db
> dump (look at pg_dump options).
>
> Regards,
> Blazej
>
> 2008/1/16, Webb Sprague <webb(dot)sprague(at)gmail(dot)com>:
>
> > In another thread, someone mentioned writing hooks for Subversion that
> > would grab function definitions and DDL statements from the current
> > database and push them into the repository?
> >
> > Does anyone have a few scripts/ cookbook examples for this? Is there
> > a cookbook section on the postgres wiki where they might go? I am
> > sure I can figure this out, but I wouldn't mind cheating....
> >
> > Thx
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: explain analyze is your friend
> >
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glyn Astill 2008-01-18 18:53:27 Re: Stupid question about WAL archiving
Previous Message Zelinskiy Alexander 2008-01-18 18:50:50 Re: Postgresql 8.2.4 on linux-sparc problem