X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 85CD252835 for ; Wed, 22 Jun 2005 16:27:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91333-10 for ; Wed, 22 Jun 2005 19:27:31 +0000 (GMT) Received: from hotmail.com (bay103-f32.bay103.hotmail.com [65.54.174.42]) by svr1.postgresql.org (Postfix) with ESMTP id 951F9528D9 for ; Wed, 22 Jun 2005 16:27:30 -0300 (ADT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 22 Jun 2005 12:27:32 -0700 Message-ID: Received: from 65.54.174.204 by by103fd.bay103.hotmail.msn.com with HTTP; Wed, 22 Jun 2005 19:27:31 GMT X-Originating-IP: [65.54.174.204] X-Originating-Email: [russellsimpkins@hotmail.com] X-Sender: russellsimpkins@hotmail.com In-Reply-To: <20364.1119467550@sss.pgh.pa.us> From: "Russell Simpkins" To: tgl@sss.pgh.pa.us Cc: pgsql-sql@postgresql.org Subject: Re: after delete trigger behavior Date: Wed, 22 Jun 2005 15:27:31 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 22 Jun 2005 19:27:32.0321 (UTC) FILETIME=[6F9F6510:01C57760] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.458 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, MSGID_FROM_MTA_HEADER X-Spam-Level: * X-Archive-Number: 200506/276 X-Sequence-Number: 21877 >I suspect that if you read the spec carefully it would want a "triggered >data change violation" error raised here. My advice is not to use a >BEFORE trigger for this. What would you recommend then. I am using Hibernate in my java application and if the sort_order column (in this example column.c) gets out of sync, then the Hibernate application fails. In hind site, the after delete trigger would be the better choice. The trigger works fine for one row deletes, but I noticed that you can't even do multiple row deletes with the trigger. Postgres only executes one row delete.