Skip site navigation (1) Skip section navigation (2)

Re: Triggers with DO functionality

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Thom Brown <thom(at)linux(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers with DO functionality
Date: 2012-02-17 21:46:30
Message-ID: 4761.1329515190@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 02/17/2012 03:58 PM, Thom Brown wrote:
>> On 17 February 2012 20:40, Dimitri Fontaine<dimitri(at)2ndquadrant(dot)fr>  wrote:
>>> I'm not so sure about other function properties (SET, COST, ROWS,
>>> SECURITY DEFINER etc) because applying default and punting users to go
>>> use the full CREATE FUNCTION syntax would be a practical answer here.

> This is going to be pretty much a piece of syntactic sugar. Would it 
> matter that much if the trigger functions made thus are all volatile? If 
> someone wants the full function feature set they can always use CREATE 
> FUNCTION first. I think I'm with Dimitri - let's keep it simple.

Volatility is a complete no-op for a trigger function anyway, as are
other planner parameters such as cost/rows, because there is no planning
involved in trigger calls.

Of the existing CREATE FUNCTION options, I think only LANGUAGE, SECURITY
DEFINER, and SET are of any possible interest for a trigger function.
And I don't have any problem deeming SET a second-order thing that you
should have to go use CREATE FUNCTION for.  But perhaps SECURITY DEFINER
is a common enough need to justify including in this shorthand form.

Has anybody stopped to look at the SQL standard for this?  In-line
trigger definitions are actually what they intend, IIRC.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2012-02-17 21:56:19
Subject: Re: Triggers with DO functionality
Previous:From: Thom BrownDate: 2012-02-17 21:16:33
Subject: Re: Triggers with DO functionality

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group