Changes in Trigger Firing - Mailing list pgsql-hackers

From Sameer Kumar
Subject Changes in Trigger Firing
Date
Msg-id CADp-Sm64HjCutCWYO8nswP8P65yTMh_1U_Y5XZ0X7ww1_CV1vQ@mail.gmail.com
Whole thread Raw
Responses Re: Changes in Trigger Firing
List pgsql-hackers
Hi all,

I am doing some changes in trigger firing mechanism (as a POC first, I will share my work if people find it useful and if it works). 

I am going to extend the trigger calls to child tables. So that in trigger definition I can create triggers with CASCADED TRUE | FALSE option.

This will enable me to extend certain triggers to child tables and get over the scenarios when a record gets inserted in child table and any *after insert* triggers on parent tables never get fired.

I am right now trying to change pg_trigger and CreateTrigger function. I have made changes in below files:
trigger.c:
     - Added a New Variable cascadedOption (bool)
     - Added a new statement in trigger.c to set the value:
                 values[Anum_pg_trigger_tgiscascaded - 1] = BoolGetDatum(stmt->cascadedOption);
     -  Added a new column in CATALOG definition of pg_trigger in pg_trigger.h 
               bool tgiscascaded;
     -  In pg_trigger.h, added a new position for values 
            #define Anum_pg_trigger_tgiscascaded    16
     - Modified parsenode.h to add a new element in Structure for trigger statement -CreateTrigStmt

                 bool        cascadedOption;

CreateTrigStmt is passed to CreateTrigger function as an arguement. I am struggling to understand how the values for various members of trigger are set and where [which file] calls CreateTrigStmt.


Can someone provide some help on this?


Best Regards,
Sameer Kumar | Database Consultant
ASHNIK PTE. LTD.
101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533
M : +65 8110 0350 T: +65 6438 3504 | www.ashnik.com
www.facebook.com/ashnikbiz | www.twitter.com/ashnikbiz

email patch

This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s).

Attachment

pgsql-hackers by date:

Previous
From: Álvaro Hernández Tortosa
Date:
Subject: Re: RFC: programmable file format for postgresql.conf
Next
From: Shigeru Hanada
Date:
Subject: Re: Custom Scan APIs (Re: Custom Plan node)