From: | Thom Brown <thom(at)linux(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | 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:16:33 |
Message-ID: | CAA-aLv4SAYTYMntMbu8aeHV269jt_xvpuf9XJYa-PdXsA+qoUQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 17 February 2012 21:07, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>
> On 02/17/2012 03:58 PM, Thom Brown wrote:
>>
>> On 17 February 2012 20:40, Dimitri Fontaine<dimitri(at)2ndquadrant(dot)fr>
>> wrote:
>>>
>>> Thom Brown<thom(at)linux(dot)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).
>>
>
> 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.
Yes, always best to start with essential functionality.
--
Thom
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-02-17 21:46:30 | Re: Triggers with DO functionality |
Previous Message | Andrew Dunstan | 2012-02-17 21:07:31 | Re: Triggers with DO functionality |