Re: [fixed] Trigger test - Mailing list pgsql-hackers

From Dmitrii Bondar
Subject Re: [fixed] Trigger test
Date
Msg-id 17a8a24f7295201873d105c5118024f5@postgrespro.ru
Whole thread Raw
In response to Re: [fixed] Trigger test  (Lilian Ontowhee <ontowhee@gmail.com>)
Responses Re: [fixed] Trigger test
List pgsql-hackers
Hi!

Thank you for the review!

> 3. Consider updating documentation for doc/src/contrib-spi.sgml, or any 
> file as appropriate, to reflect the changes.

The changes have now been added to doc/src/contrib-spi.sgml. I also 
added a consideration note about interactions with BEFORE triggers.

> 4. Are there any cases where check_primary_key() and 
> check_foreign_key() should be called using a BEFORE trigger? Will this 
> change break backwards compatibility? Consider adding a test with a 
> BEFORE trigger to ensure the error "must be fired by AFTER trigger" is 
> raised.

The usage within BEFORE triggers appears to be entirely incorrect. The 
functions check_primary_key() and check_foreign_key() are intended for 
use in creating constraint triggers, which according to the 
documentation must be AFTER ROW triggers. Therefore, any cases using 
BEFORE triggers are invalid.

I have updated the test so that it now raises the error "must be fired 
by AFTER trigger."

Can you also help me with the patch status? What status should I move 
the patch to?
Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Reduce "Var IS [NOT] NULL" quals during constant folding
Next
From: Dean Rasheed
Date:
Subject: Re: gamma() and lgamma() functions