From: | Alfranio Correia Junior <alfranio(at)lsd(dot)di(dot)uminho(dot)pt> |
---|---|
To: | Alvaro Herrera <alvherre(at)surnet(dot)cl> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: HOOKS for Synchronous Replication |
Date: | 2005-06-21 08:36:10 |
Message-ID: | 42B7D17A.9000709@lsd.di.uminho.pt |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thank you for the comments.
>First of all your patch does not conform with the project style. Please
>have a look at how other files are indented, in particular regarding
>brace position and ereport() arguments (any function arguments really,
>but in ereport your problems are more visible). Also, always use
>ereport() for user messages, elog() for conditions that involve
>can't-happen situations (server bugs, like not finding a tuple in a
>catalog that should be there, etc).
>
>
OK !!! I am going to correct these problems.
>Also there are some changes that you certainly don't want committed.
>For example why are you removing the TransState from xact.c?
>
>
I simply moved it to the xact.h...
Basically, it was done to be able to access the current transaction
state from other files.
Thus, I can avoid to rebuild the structure that stores the global
triggers in the middle of a transaction.
However, the lack of this functionality it is not critical since the
superuser is the only
person that can change such triggers.
>Also, consider using the XactCallback mechanism instead of inventing
>your own.
>
>
>
Unfortunately, the XactCallback is called after "commit" which
means that a transaction cannot be rolled back.
For synchronous replication, it is necessary to have a before commit event.
Moreover, the addition of a callback function implies modifications to
the source code, am I wrong ?
These global triggers could be easily adapted to call functions "before"
and "after commit" without
changing the code.
>On a different front, have you considered talking to the people behind
>Slony-II to see if they'd have some use for your hooks?
>
>
>
I would like to share the hooks with them and other things that I have
been done.
Best regards,
Alfranio Junior.
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Bartunov | 2005-06-21 09:02:07 | Re: Schedule for 8.1 feature freeze |
Previous Message | Dave Page | 2005-06-21 08:16:21 | Re: [PATCHES] default database creation with initdb |