Re: Transactional behaviour with trigger - Mailing list pgsql-sql

From Joost Kraaijeveld
Subject Re: Transactional behaviour with trigger
Date
Msg-id 1158504977.6107.27.camel@panoramix
Whole thread Raw
In response to Re: Transactional behaviour with trigger  (Michael Fuhr <mike@fuhr.org>)
List pgsql-sql
Hi Michael,

Thanks for answering.


On Sun, 2006-09-17 at 08:36 -0600, Michael Fuhr wrote:
> On Sun, Sep 17, 2006 at 02:32:10PM +0200, Joost Kraaijeveld wrote:
> Where does prototype.customers fit in?  Are you sure it has a row
> that matches the WHERE clause?  Where would that row have come from?
I have solved it by rethinking what was actually happening and boosting
the traces of JBoss to see what it actually did. 

It actually did this:
1. start transaction
2. add customer record
3. add contactaddress record
4  update the customer record   <--- !!!!
5. end transction

So I moved the update of the materialized view to an update trigger of
the customer table and now it works.

> Is there a reason you're maintaining customeraddress as a materialized
> view rather than as a "real" view?
Pure performance reasons.


-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Transactional behaviour with trigger
Next
From: "Aaron Bono"
Date:
Subject: Re: Dividing results from two tables with different time frames