Re: trigger: NEW/OLD-error or nothing happens - Mailing list pgsql-general

From Knut Suebert
Subject Re: trigger: NEW/OLD-error or nothing happens
Date
Msg-id 20010719124421.A11169@cascal.vtb
Whole thread Raw
In response to Re: trigger: NEW/OLD-error or nothing happens  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-general
Jan Wieck schrieb:

>     You  can use RAISE NOTICE to have *debugging* without rolling
>     back the transaction.

Nice, thnx |-)

>     Maybe it'd help to add more RAISE's  to
>     see the values of NEW.sport and NEW.dport as well?

I tried and it works, I removed it and it still works. I really don't
know, where the difference compared to the first tries is, but anyway:

    create function nac_viceversa() returns opaque as'
    begin
        NEW.minport := nacmin(NEW.sport,NEW.dport);
        NEW.maxport := nacmax(NEW.sport,NEW.dport);
        return NEW;
    end;
    'language 'plpgsql';

    create trigger nac_update before insert or update on traf
    for each row execute procedure nac_viceversa();

Bye,
Knut

pgsql-general by date:

Previous
From: Ben-Nes Michael
Date:
Subject: list all indices
Next
From: Tomaz Borstnar
Date:
Subject: Re: VACUUM ANALYZE