ON DELETE trigger blocks delete from my table

From: "Naeem Bari" <naeem(dot)bari(at)agilissystems(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: ON DELETE trigger blocks delete from my table
Date: 2004-10-25 18:56:47
Message-ID: 53F35087CC531844AD19CCAE6FA669293689@util.agilissystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am using postgres 7.4.5 on Redhat Enterprise Linux 3.

My background is really on Oracle, and I am porting a largish database
over to postgres.

Here is my problem:

On oracle, I had a table with an "on update or delete" trigger that
copied the current row out to an audit table. Works like a champ. On
postgres, when I try to delete a row, all it gives back to me is "DELETE
0" and does nothing.

Here is the text of the trigger:

~~~~~~~~~~
CREATE OR REPLACE FUNCTION public.func_job_status_upd()
RETURNS trigger AS
'
begin
insert into x_job_status values ( OLD.job_id, OLD.job_status_type_id,
OLD.status_date, OLD.notes, OLD.edit_person_id, OLD.edit_date);
return new;
end;
'
LANGUAGE 'plpgsql' VOLATILE;
~~~~~~~~~~

Any help would be appreciated!

Thanks,
naeem

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2004-10-25 18:58:43 Re: Bug or stupidity
Previous Message Dan Sugalski 2004-10-25 18:54:29 Re: Arrays, placeholders, and column types