Iï¿½m trying to implement Statement Triggers in postgreSQL. The basic idea is
check (in ExcutePlan) if there are statement before call first time to
ExecAppend, ExecDelete or ExecUpdate (or after the last call in case of
after statement).

But if I exec "Insert into tbtest values (22,'cadena');" then ExecutePlan is
call two times, and ExecX too. Why?
The execution trace is:
 Entering ExecutePlan
 Calling ExecAppend
 Entering ExecAppend
 Entering ExecutePlan
 Calling ExecAppend
 Entering ExecAppend

Other Question: SQL3 says
" The execution of triggered actionsdepends on the cursosr mode of the
current SQ-transaction. If the cursor mode is set to cascade off, then the
execution of the <triggered SQL statement>s is effectively deferred until
enacted implicitly by execution of a <commit statement> or a <close
statement>. Otherwise, the <triggered SQl statement>s are effectively
executed ..."

How apply this to postgre?

Thanks everybody.


F.J.Cuberos


Sun, 15 Aug 1999 16:28:03 +0200
"F J Cuberos" <fjcuberos@infomail.lacaixa.es>
Statement Triggers. Ideas & help.
Forget the problem with Executeplan, I was getting the syslogs and stdour
messages in the same screen; SO DOUBLE!!!!.

With statement triggers (and defined in SQL3 too) will be interesting to
access OLD and NEW values of modified tables. How can be implemented? Itï¿½s
possible to use MVCC for this?

Thanks

F.J. Cuberos
Sevilla - Spain


Mon, 16 Aug 1999 00:41:51 +0200
"F J Cuberos" <fjcuberos@infomail.lacaixa.es>
RE: [HACKERS] Statement Triggers. Ideas & help.
F J Cuberos wrote:
> 
> Forget the problem with Executeplan, I was getting the syslogs and stdour
> messages in the same screen; SO DOUBLE!!!!.
> 
> With statement triggers (and defined in SQL3 too) will be interesting to
> access OLD and NEW values of modified tables. How can be implemented? Itï¿½s
> possible to use MVCC for this?

MVCC uses t_xmin/t_xmax to decide what's visible to transaction.
For OLD/NEW you will have to analyze t_cmin/t_cmax as well.

Vadim

Tue, 17 Aug 1999 09:55:27 +0800
Vadim Mikheev <vadim@krs.ru>
Re: [HACKERS] Statement Triggers. Ideas & help.
At 09:55 17/08/99 +0800, Vadim Mikheev wrote:
>F J Cuberos wrote:
>> 
>> Forget the problem with Executeplan, I was getting the syslogs and stdour
>> messages in the same screen; SO DOUBLE!!!!.
>> 
>> With statement triggers (and defined in SQL3 too) will be interesting to
>> access OLD and NEW values of modified tables. How can be implemented? Itï¿½s
>> possible to use MVCC for this?
>
>MVCC uses t_xmin/t_xmax to decide what's visible to transaction.
>For OLD/NEW you will have to analyze t_cmin/t_cmax as well.

FWIW, Dec (Oracle) Rdb does not allow access to OLD & NEW in statement
triggers; if you want the rows, you have to write 'for each row' triggers.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 008 659 498)             |          /(@)   ______---_
Tel: +61-03-5367 7422            |                 _________  \
Fax: +61-03-5367 7430            |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Tue, 17 Aug 1999 15:29:47 +1000
Philip Warner <pjw@rhyme.com.au>
Re: [HACKERS] Statement Triggers. Ideas & help.