Re: Triggers with DO functionality

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: Triggers with DO functionality
Дата
Msg-id CAA-aLv4efPdk-oaztf++Q34BiQtT6zQHk+9ft1HFVvknsaheOA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Triggers with DO functionality  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Triggers with DO functionality  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
On 17 February 2012 17:26, Peter Eisentraut <peter_e@gmx.net> wrote:
> On fre, 2012-02-17 at 13:22 +0000, Thom Brown wrote:
>> So instead of
>>
>> CREATE TRIGGER...
>> EXECUTE PROCEDURE functioname();
>>
>> you'd have:
>>
>> CREATE TRIGGER...
>> DO $$
>> ...
>> $$;
>
> I had wished for this many times and was about to propose something
> similar.
>
> We might wish to review the SQL standard and other implementations to
> make porting triggers a bit easier too.

I had looked at how a couple other RDBMS's do it, and there are:

CREATE TRIGGER...
BEGIN
END;

and

CREATE TRIGGER...
AS
BEGIN
END;

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.

-- 
Thom


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Command Triggers
Следующее
От: Robert Haas
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB