Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-30 Thread Edmund Bacon
[EMAIL PROTECTED] ("Naeem Bari") writes: > I understand. Makes sense. Is there anyway for my trigger function to > "know" that it is being called on a delete or on an update? Because I do > need to "return new" on update... and I really don't want to write 2 > different functions, one for update a

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-26 Thread Richard_D_Levine
Sent by: cc: <[EMAIL PROTECTED]> [EMAIL PROTECTED] Subject: Re: [GENERAL] ON DELETE trigger blocks delete fr

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Oliver Elphick
On Mon, 2004-10-25 at 15:09 -0500, Naeem Bari wrote: > Ok, a really newbie question - I think I will switch to using "after" > rather than "before" - but can I modify the trigger statement without > dropping the trigger function? CREATE OR REPLACE FUNCTION ... -- Oliver Elphick

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
p! naeem -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Monday, October 25, 2004 2:48 PM To: Naeem Bari Cc: [EMAIL PROTECTED] Subject: Re: [GENERAL] ON DELETE trigger blocks delete from my table "Naeem Bari" <[EMAIL PROTECTED]> writes: CREATE OR REPLACE FU

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 3:47 PM, Tom Lane wrote: "Naeem Bari" <[EMAIL PROTECTED]> 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)

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
D] Subject: Re: [GENERAL] ON DELETE trigger blocks delete from my table On 10/25/2004 3:33 PM, Franco Bruno Borghesi wrote: > 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

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
October 25, 2004 2:48 PM To: Naeem Bari Cc: [EMAIL PROTECTED] Subject: Re: [GENERAL] ON DELETE trigger blocks delete from my table "Naeem Bari" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION public.func_job_status_upd() > RETURNS trigger AS >

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 3:33 PM, Franco Bruno Borghesi wrote: 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 :(. Because the internal variable for NEW is in

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Tom Lane
"Naeem Bari" <[EMAIL PROTECTED]> 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; >

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 2:56 PM, 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 cu

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Franco Bruno Borghesi
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

[GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
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