Re: Shorthand syntax for triggers - Mailing list pgsql-general

From Moshe Jacobson
Subject Re: Shorthand syntax for triggers
Date
Msg-id CAJ4CxLn-AXFL-x364bM8aqHmF5ZVoEFAefYs63C4JWTbB=gE2Q@mail.gmail.com
Whole thread Raw
In response to Re: Shorthand syntax for triggers  (Sergey Konoplev <gray.ru@gmail.com>)
Responses Re: Shorthand syntax for triggers  (Sergey Konoplev <gray.ru@gmail.com>)
List 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 by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: WebSphere Application Server support for postgres
Next
From: Sergey Konoplev
Date:
Subject: Re: Shorthand syntax for triggers