On Mon, Oct 15, 2012 at 11:36 AM, Moshe Jacobson <mo...@neadwerx.com> wrote:
>> IF TG_OP = 'DELETE' THEN RENAME OLD TO myrow;
>> ELSE RENAME NEW TO myrow; END IF;
>
> Does the RENAME syntax actually work? My understanding is that it has been
> broken for a long time.

Oh, you got a point! It does not work since 9.0. I forget it, sorry.

Another way to do it is:

DECLARE
    myrow record;
    ...
BEGIN
    myrow := CASE WHEN TG_OP = 'DELETE' THEN OLD ELSE NEW END;
    ...

-- 
Sergey Konoplev

a database and software architect
http://www.linkedin.com/in/grayhemp

Jabber: gray...@gmail.com Skype: gray-hemp Phone: +14158679984


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to