[PATCH] Allow queries in WHEN expression of FOR EACH STATEMENT triggers - Mailing list pgsql-hackers

From Joe Wildish
Subject [PATCH] Allow queries in WHEN expression of FOR EACH STATEMENT triggers
Date
Msg-id C47C490A-BAEC-4879-BC96-737BB4BF3DC1@lateraljoin.com
Whole thread Raw
Responses Re: [PATCH] Allow queries in WHEN expression of FOR EACH STATEMENT triggers
Re: [PATCH] Allow queries in WHEN expression of FOR EACH STATEMENT triggers
List pgsql-hackers
Hi hackers,

Attached is a patch for supporting queries in the WHEN expression of 
statement triggers. It is restricted so that the expression can 
reference only the transition tables and the table to which the trigger 
is attached. This seemed to make the most sense in that it follows what 
you can do in the per row triggers. I did have a look in the standards 
document about triggers, and couldn't see any restrictions mentioned, 
but nevertheless thought it made most sense.

One possibility controversial aspect is that the patch doesn't use SPI 
to evaluate the expression; it constructs a Query instead and passes it 
to the executor. Don't know what people's thoughts are on doing that?

-Joe
Attachment

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Improve Managing Databases Overview Doc Page
Next
From: "Hsu, John"
Date:
Subject: Re: Physical slot restart_lsn advances incorrectly requiring restore from archive