Re: Triggers not working - Mailing list pgsql-general

From Tom Lane
Subject Re: Triggers not working
Date
Msg-id 11703.1222086114@sss.pgh.pa.us
Whole thread Raw
In response to Triggers not working  ("Dale Harris" <itsupport@jonkers.com.au>)
Responses Re: Triggers not working  ("Dale Harris" <itsupport@jonkers.com.au>)
List pgsql-general
"Dale Harris" <itsupport@jonkers.com.au> writes:
> I'm running PostgreSQL 8.3.3 and I'm having trouble with triggers not always
> working.  I have the following tables and functions as documented below.  My
> problem is that if I perform an update on the Entity table and modify the
> Code field, why doesn't the trigger for the Entity table execute?  (Row was
> initially added via the Account table.)

Worksforme ...

regression=# insert into "Account" values(1,'code','name');
INSERT 0 1
regression=# select * from "Entity";
 ID | Code | Name |         Modified          | ModifiedBy
----+------+------+---------------------------+------------
  1 | code | name | 2008-09-22 08:19:51.70-04 | postgres
(1 row)

regression=# update "Entity" set "Code" = 'foo' where "ID" = 1;
NOTICE:  trAccountUpdate being called for UPDATE of Account.
UPDATE 1
regression=# select * from "Entity";
 ID | Code | Name |         Modified          | ModifiedBy
----+------+------+---------------------------+------------
  1 | foo  | name | 2008-09-22 08:20:18.10-04 | postgres
(1 row)


            regards, tom lane

pgsql-general by date:

Previous
From: Mark Cave-Ayland
Date:
Subject: Re: R-tree, order by, limit
Next
From: Jiri Ogurek
Date:
Subject: Thesis resource help