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

Re: Triggers with DO functionality

From: Thom Brown <thom(at)linux(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: 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 20:58:59
Message-ID: CAA-aLv6oh49XT8fv8Tnqsq0i1L_RP7O+rxPkWNY7KnJQtXQ0eA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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).

-- 
Thom

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2012-02-17 21:07:31
Subject: Re: Triggers with DO functionality
Previous:From: Jay LevittDate: 2012-02-17 20:47:35
Subject: Re: Designing an extension for feature-space similarity search

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