pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: treat00@yahoo.com
To: pgsql-sql@postgresql.org
Subject: "on insert" rules happen before the insert?
Date: 30 Dec 2003 13:49:06 -0800
Message-ID: <3c4289ad.0312301349.2e9ac46f@posting.google.com> (raw)

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 rule does an insert that is failing, and the whole insert fails. So in 
this case it's not a huge problem. But I get a completely useless error 
message, and as far as I can tell there is no way to determine exactly what
caused the failure (except for the fact that I happen to know what rule
can cause that error). 

I'd like the person inserting a row that violates the foreign key check to
get a useful error message.

Is this a documentation bug? How can I get the desired behavior?



view thread (2+ messages)  latest in thread

Message-ID: <3c4289ad.0312301349.2e9ac46f@posting.google.com>
Permalink:  ../3c4289ad.0312301349.2e9ac46f@posting.google.com/
Also on:    postgresql.org/message-id/3c4289ad.0312301349.2e9ac46f@posting.google.com

 · 

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: treat00@yahoo.com
  Subject: Re: "on insert" rules happen before the insert?
  In-Reply-To: <3c4289ad.0312301349.2e9ac46f@posting.google.com>

* 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