Re: Trigger Update Issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "beer" <beer(at)cmu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger Update Issue
Date: 2004-03-05 16:11:00
Message-ID: 7944.1078503060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"beer" <beer(at)cmu(dot)edu> writes:
> I'm running 7.3.4-1 on a RH9 box. I'm having a problem with a trigger
> that seems to execute without actually performing the update that it
> should. The update returns true everytime however if it is the first time
> that the trigger executes on a given row, the column is not updated. The
> column is updated correctly on subsequent calls.

I couldn't reproduce this. I created the tables and trigger and then
did:

regression=# insert into tabA values('id1','col1', 2, 32);
INSERT 154119 1
regression=# insert into tabB values(1,'id1','col1','col2');
INSERT 154120 1
regression=# select * from tabA;
id | acol1 | acol2 | acol3
----------------------------------+------------------------------------------+-------+-------
id1 | col1 | 2 | 33
(1 row)

regression=# insert into tabB values(2,'id1','col1','col2');
INSERT 154121 1
regression=# select * from tabA;
id | acol1 | acol2 | acol3
----------------------------------+------------------------------------------+-------+-------
id1 | col1 | 2 | 34
(1 row)

It looks fine to me ... what are you doing differently?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message George Essig 2004-03-05 16:23:30 Re: Are Postgres 7.4.1 RPMs available for SuSE 9.0 ?
Previous Message phil campaigne 2004-03-05 15:58:00 Setting up Postgresql on Linux