Re: Shorthand syntax for triggers

Поиск
Список
Период
Сортировка
От Moshe Jacobson
Тема Re: Shorthand syntax for triggers
Дата
Msg-id CAJ4CxLn-AXFL-x364bM8aqHmF5ZVoEFAefYs63C4JWTbB=gE2Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Shorthand syntax for triggers  (Sergey Konoplev <gray.ru@gmail.com>)
Ответы Re: Shorthand syntax for triggers  (Sergey Konoplev <gray.ru@gmail.com>)
Список pgsql-general
On Wed, Oct 10, 2012 at 4:28 PM, Sergey Konoplev <gray.ru@gmail.com> wrote:
> I wish I could do:
>
> create trigger some_trigger after insert on products
> execute procedure do $$ begin
> insert into audits values (CHANGED.value);
> end $$ language plpgsql;

IF TG_OP = 'DELETE' THEN RENAME OLD TO myrow;
ELSE RENAME NEW TO myrow; END IF;

and then use

insert into audits values (myrow.value);

Does the RENAME syntax actually work? My understanding is that it has been broken for a long time.

--
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@neadwerx.com | 
www.neadwerx.com

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: WebSphere Application Server support for postgres
Следующее
От: Sergey Konoplev
Дата:
Сообщение: Re: Shorthand syntax for triggers