On Wed, Oct 10, 2012 at 4:28 PM, Sergey Konoplev <gray.ru@xxxxxxxxx> wrote:
Does the RENAME syntax actually work? My understanding is that it has been broken for a long time.
> I wish I could do:IF TG_OP = 'DELETE' THEN RENAME OLD TO myrow;
>
> create trigger some_trigger after insert on products
> execute procedure do $$ begin
> insert into audits values (CHANGED.value);
> end $$ language plpgsql;
ELSE RENAME NEW TO myrow; END IF;
and then use
insert into audits values (myrow.value);
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@xxxxxxxxxxxx | www.neadwerx.com
moshe@xxxxxxxxxxxx | www.neadwerx.com