X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 181B89FB25D for ; Sun, 17 Sep 2006 11:56:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 16991-09 for ; Sun, 17 Sep 2006 14:56:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by postgresql.org (Postfix) with ESMTP id 8D2939FB256 for ; Sun, 17 Sep 2006 11:56:21 -0300 (ADT) Received: obelix 172.31.0.1 from 172.31.1.1 172.31.1.1 via HTTP with MS-WebStorage 6.0.6249 Received: from panoramix by obelix; 17 Sep 2006 16:56:17 +0200 Subject: Re: Transactional behaviour with trigger From: Joost Kraaijeveld To: Michael Fuhr Cc: pgsql-sql@postgresql.org In-Reply-To: <20060917143646.GA96792@winnie.fuhr.org> References: <1158496330.6107.17.camel@panoramix> <20060917143646.GA96792@winnie.fuhr.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sun, 17 Sep 2006 16:56:17 +0200 Message-Id: <1158504977.6107.27.camel@panoramix> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200609/118 X-Sequence-Number: 26329 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