Обсуждение: SVN event hooks for PL/PGSQL functions and DDL?

Поиск
Список
Период
Сортировка

SVN event hooks for PL/PGSQL functions and DDL?

От
"Webb Sprague"
Дата:
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

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

От
"Webb Sprague"
Дата:
I don't mean to be thick headed, but  ...

On Jan 18, 2008 1:11 AM, Blazej Oleszkiewicz <bl.oleszkiewicz@gmail.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.sprague@gmail.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
> >
>