Re: Triggers do not fire

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Reiner Dassing <dassing(at)wettzell(dot)ifag(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Triggers do not fire
Date: 2001-10-16 21:36:08
Message-ID: 22705.1003268168@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Reiner Dassing <dassing(at)wettzell(dot)ifag(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-10-16 22:56:22 Re: index problem
Previous Message CoL 2001-10-16 21:08:07 Re: index problem