"Naeem Bari" <naeem.bari@agilissystems.com> writes:
> 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;
If this is a BEFORE trigger, you probably need "RETURN OLD". "NEW" will
be NULL in a delete trigger, so you're returning NULL which cancels the
operation.
regards, tom lane