[NOVICE] trigger on delete/field update - Mailing list pgsql-novice

From Ruslan R. Laishev
Subject [NOVICE] trigger on delete/field update
Date
Msg-id 1880941508164058@web15o.yandex.ru
Whole thread Raw
Responses Re: [NOVICE] trigger on delete/field update  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-novice
Hi All!
 
I have tried to set a flag ('deleted' ) instead of actual record deletion, so I have tried to accomplish it with next piece of code in the trigger:
 
BEGIN
/*
**  Description: disable  deletion of the rows from the table,
**    instead we set .deleted flag to 1
*/
 
        IF (TG_OP = 'DELETE') THEN
         UPDATE v.comps SET deleted = 1 WHERE v.comps.id = OLD.id;
                RETURN NULL;
        END IF;
 
END;
 
 
DELETE row on the table v does not generate any error, but row still here and 'deleted' field has not been set to 1 as expected.
So, what I'm need to check ?
 
 
 
TIA.
 
-- 
С уважением,
Ruslan R. Laishev
OpenVMS bigot, natural born system/network progger, C contractor.
+79013163222
+79910009922
 

pgsql-novice by date:

Previous
From: manno_it@libero.it
Date:
Subject: Re: [NOVICE] The server does not listen
Next
From: Adarsh Jaiswal
Date:
Subject: Re: [NOVICE] The server does not listen