pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Reiner Dassing <dassing@wettzell.ifag.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Triggers do not fire
Date: Tue, 16 Oct 2001 17:36:08 -0400
Message-ID: <22705.1003268168@sss.pgh.pa.us> (raw)
In-Reply-To: <3BCC2CBB.9C3A31EF@wettzell.ifag.de>
References: <3BCC2CBB.9C3A31EF@wettzell.ifag.de>

Reiner Dassing <dassing@wettzell.ifag.de> 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



view thread (7+ messages)  latest in thread

Message-ID: <22705.1003268168@sss.pgh.pa.us>
Permalink:  ../22705.1003268168@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22705.1003268168@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dassing@wettzell.ifag.de
  Subject: Re: Triggers do not fire
  In-Reply-To: <22705.1003268168@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox