Re: Triggers with DO functionality - Mailing list pgsql-hackers

From Thom Brown
Subject Re: Triggers with DO functionality
Date
Msg-id CAA-aLv6oh49XT8fv8Tnqsq0i1L_RP7O+rxPkWNY7KnJQtXQ0eA@mail.gmail.com
Whole thread Raw
In response to Re: Triggers with DO functionality  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Triggers with DO functionality  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 17 February 2012 20:40, Dimitri Fontaine <dimitri@2ndquadrant.fr> wrote:
> Thom Brown <thom@linux.com> writes:
>> And thinking about it, DO is a bit nonsense here, so maybe we'd just
>> have something like:
>>
>> CREATE TRIGGER...
>> AS $$
>> BEGIN
>> END;
>> $$;
>>
>> i.e. the same as a function.
>
> I like that.  How do you tell which language the trigger is written in?

Exactly the same as a function I'd imagine.  Just tack LANGUAGE
<language>; at the end.

> 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.

*shrug* There's also the question about the stability of the trigger's
own in-line function too (i.e. IMMUTABLE, STABLE, VOLATILE).

--
Thom


pgsql-hackers by date:

Previous
From: Jay Levitt
Date:
Subject: Re: Designing an extension for feature-space similarity search
Next
From: Andrew Dunstan
Date:
Subject: Re: Triggers with DO functionality