Do Something before Abort on Trigger ???

From: "Yudha Setiawan" <yudha(at)BonBon(dot)net>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Do Something before Abort on Trigger ???
Date: 2003-01-17 01:23:44
Message-ID: 005c01c2bdc9$77b8c870$ea00a8c0@yudha
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Somebody Help Me.....

Using my previous Database I used to be like that;
" ALTER TRIGGER tr_T_DtlPO ON dbo.T_DtlPO FOR UPDATE AS
bla..bla..bla...
IF @OldQty <> @NewQty BEGIN
ROLLBACK
INSERT INTO T_My_ListError(fc_code,fv_descript)
VALUES('12345','No Authority to Change Qty')
END"
So I'v already write the error code to table T_My_ListError before aborting this session
-----------------------------------------------------------------------------------------
And I Tried on Postgre like that;
" create or replace function fn_tr_t_dtlpo returns trigger as'
begin
bla..bla...;
if new.fn_qty != old.fn_qty then
raise exception ''Error 12345'';
insert into t_my_listerror(fc_code,fv_descript)
values(''12345'',''No Authority to Change Qty'');
end if;
end;' language 'plpgsql';
"
But I Couldn't get any records at all on t_my_listerror. Even when put the insert statement
(insert into t_my_listerror...bla..bla) before raise exception.

Some advice will be very helpfull to me. Thank's a lot and ...
GOD Bless You All.

Browse pgsql-admin by date

  From Date Subject
Next Message Kemin Zhou 2003-01-17 02:17:53 pg_restore problem
Previous Message Tim Lynch 2003-01-17 01:06:21 Re: OT: seeking query help, where?