Thread: Statement Triggers. Ideas & help.

Statement Triggers. Ideas & help.

From
"F J Cuberos"
Date:
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 ExecutePlanCalling ExecAppendEntering ExecAppendEntering ExecutePlanCalling
ExecAppendEnteringExecAppend
 

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



RE: [HACKERS] Statement Triggers. Ideas & help.

From
"F J Cuberos"
Date:
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



Re: [HACKERS] Statement Triggers. Ideas & help.

From
Vadim Mikheev
Date:
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


Re: [HACKERS] Statement Triggers. Ideas & help.

From
Philip Warner
Date:
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   |/