Re: trigger: NEW/OLD-error or nothing happens

From: Knut Suebert <knut(dot)suebert(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger: NEW/OLD-error or nothing happens
Date: 2001-07-19 10:44:21
Message-ID: 20010719124421.A11169@cascal.vtb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomaz Borstnar 2001-07-19 10:53:08 Re: VACUUM ANALYZE
Previous Message Ben-Nes Michael 2001-07-19 10:23:16 list all indices