Search Postgresql Archives

Re: Shorthand syntax for triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 10, 2012 at 4:28 PM, Sergey Konoplev <gray.ru@xxxxxxxxx> 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@xxxxxxxxxxxx | 
www.neadwerx.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux