Re: Changes in Trigger Firing

From: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Changes in Trigger Firing
Date: 2013-12-05 13:34:29
Message-ID: CADp-Sm4TfjZhJx=uqk451zgYQAZTsmEQaggZsBvHkkvtLsQ6ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers

I have been finally able to get the right set of files. I going with below
approach:

1) Add a new column in pg_trigger called tgiscascaded

2) Change pg_trigger.h for this

3) Made changes in trigger.c to insert this values

4) Corresponding changes made in
- reltrigger.h
- parsenode.h

5) Changed gram.y to understand a new key word in CREATE TRIGGER statement
"CASCADED".
- The new option will be optional and will apply only to
non-constraint triggers
- If the option is specified trigger will CASCADE to child
tables

6) I just complied the source code (modified with above changes) and it
- Added a new column in pg_trigger
- The new column is able to derive its value from CREATE
TRIGGER statement based on whether CASDADED was specified or not
- The value is True if the option was specified
- The value is false if the option was not specified

7) Now I will work on trigger firing mechanism with below approach
- Before firing triggers, check if it's an inherited table
- First get CASCADED triggers for parents and fire them
- Proceed as usual

Any suggestion on improving the approach or comments on need for this
feature are welcome.

Regards
Sameer

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Sameer Kumar 2013-12-05 13:43:54 Re: [HACKERS] Changes in Trigger Firing
Previous Message Sameer Kumar 2013-12-05 10:17:38 Re: Changes in Trigger Firing

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-12-05 13:42:35 Re: pgsql: Fix a couple of bugs in MultiXactId freezing
Previous Message Andres Freund 2013-12-05 13:29:31 Re: shared memory message queues