Re: Trigger Update Issue - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger Update Issue
Date
Msg-id 7944.1078503060@sss.pgh.pa.us
Whole thread Raw
In response to Trigger Update Issue  ("beer" <beer@cmu.edu>)
List pgsql-general
"beer" <beer@cmu.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

pgsql-general by date:

Previous
From: phil campaigne
Date:
Subject: Setting up Postgresql on Linux
Next
From: "Chris Boget"
Date:
Subject: Re: REFERENCES error message complaint, suggestion