Re: ON DELETE trigger blocks delete from my table

Поиск
Список
Период
Сортировка
От Franco Bruno Borghesi
Тема Re: ON DELETE trigger blocks delete from my table
Дата
Msg-id 1098732811.1995.5.camel@taz.oficina
обсуждение исходный текст
Ответ на ON DELETE trigger blocks delete from my table  ("Naeem Bari" <naeem.bari@agilissystems.com>)
Ответы Re: ON DELETE trigger blocks delete from my table  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-general
I've made a test case, and setting the trigger BEFORE DELETE doesn't delete the rows from the table (but it does execute the trigger, and it does insert the rows in the audit table), I dont' know why :(.

Anyway, setting the trigger AFTER DELETE works ok.

On Mon, 2004-10-25 at 15:56, Naeem Bari wrote:
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


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Jeffrey Melloy
Дата:
Сообщение: Re: combining two queries?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: The reasoning behind having several features outside