X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3926ED1B44E for ; Mon, 5 Jan 2004 05:27:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 99213-07 for ; Mon, 5 Jan 2004 01:26:56 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id D89BED1B454 for ; Mon, 5 Jan 2004 01:26:54 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i055Qs19021897; Mon, 5 Jan 2004 00:26:54 -0500 (EST) To: treat00@yahoo.com (Thomas Reat) Cc: pgsql-sql@postgresql.org Subject: Re: "on insert" rules happen before the insert? In-reply-to: <3c4289ad.0312301349.2e9ac46f@posting.google.com> References: <3c4289ad.0312301349.2e9ac46f@posting.google.com> Comments: In-reply-to treat00@yahoo.com (Thomas Reat) message dated "30 Dec 2003 13:49:06 -0800" Date: Mon, 05 Jan 2004 00:26:54 -0500 Message-ID: <21896.1073280414@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/26 X-Sequence-Number: 16419 treat00@yahoo.com (Thomas Reat) writes: > The postgresql documentation claims that "on insert" rules are executed > after the insert. This is not happening for me. I have a rule that is being > executed even though the insert should have failed due to a foreign key check. The INSERT certainly happens before any rules that it triggers. But foreign key checks probably don't happen until all the dust has settled. This is arguably not a bug --- there are situations where it's essential. regards, tom lane