Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9GLaCP86167 for ; Tue, 16 Oct 2001 17:36:12 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f9GLa8c22708; Tue, 16 Oct 2001 17:36:08 -0400 (EDT) To: Reiner Dassing cc: pgsql-sql@postgresql.org Subject: Re: Triggers do not fire In-reply-to: <3BCC2CBB.9C3A31EF@wettzell.ifag.de> References: <3BCC2CBB.9C3A31EF@wettzell.ifag.de> Comments: In-reply-to Reiner Dassing message dated "Tue, 16 Oct 2001 14:48:59 +0200" Date: Tue, 16 Oct 2001 17:36:08 -0400 Message-ID: <22705.1003268168@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/222 X-Sequence-Number: 5177 Reiner Dassing writes: > I have written a very small test procedure to show a possible error > on PostgreSQL V7.1.1. The error is yours: you set up the trigger function to return NULL, which means it's telling the system not to allow the INSERT or UPDATE. > INSERT INTO test VALUES(1,'2000-10-11 12:00:00',-20.2); > NOTICE: Fired INSERT > INSERT 0 0 Note the summary line saying that zero rows were inserted. > UPDATE test SET value = 1000.0 WHERE epoch = '2000-10-11 12:10:00' AND > sensor_id = 1; > UPDATE 0 Here, zero rows were updated, so of course there was nothing to fire the trigger on. regards, tom lane