pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: treat00@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: "on insert" rules happen before the insert?
Date: Mon, 05 Jan 2004 00:26:54 -0500
Message-ID: <21896.1073280414@sss.pgh.pa.us> (raw)
In-Reply-To: <3c4289ad.0312301349.2e9ac46f@posting.google.com>
References: <3c4289ad.0312301349.2e9ac46f@posting.google.com>

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



view thread (2+ messages)

Message-ID: <21896.1073280414@sss.pgh.pa.us>
Permalink:  ../21896.1073280414@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21896.1073280414@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, treat00@yahoo.com
  Subject: Re: "on insert" rules happen before the insert?
  In-Reply-To: <21896.1073280414@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox