Re: Rule appears not to fire on insert w/ "except" - Mailing list pgsql-general

From Jerry Sievers
Subject Re: Rule appears not to fire on insert w/ "except"
Date
Msg-id m3wtj1cx0w.fsf@prod01.jerrysievers.com
Whole thread Raw
In response to Rule appears not to fire on insert w/ "except"  (Chris Kratz <chris.kratz@vistashare.com>)
Responses Re: Rule appears not to fire on insert w/ "except"  (David Fetter <david@fetter.org>)
Re: Rule appears not to fire on insert w/ "except"  (Chris Kratz <chris.kratz@vistashare.com>)
List pgsql-general
Chris Kratz <chris.kratz@vistashare.com> writes:

> Hello All,
>
> We have finally tracked down a bug in our application to a rewrite rule on a
> table.  In essence, the rewrite rule in question logs any inserts to another
> table.  This works correctly in all cases except where an "except" clause is
> used in the insert statement.  In this case, the rows are inserted into the
> primary table as expected, but the rule either does not fire, or fires in
> such a way that nothing is placed in the changes table.

You must be referring to something like;

insert into foo
select *
from sometable
except
select *
from someothertable
;

If there's an EXCEPT clause on INSERT, I've never seen it.

Perhaps you should post your insert query and your rule declaration.

>  As a side note, is there a way to see the final sql after all "rewrite" rules
> have been processed?  It might help us understand what is going on.

Not SQL but see config setting;

debug_print_rewritten

--
-------------------------------------------------------------------------------
Jerry Sievers   305 854-3001 (home)     WWW ECommerce Consultant
                305 321-1144 (mobile    http://www.JerrySievers.com/

pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Best way to represent values.
Next
From: David Fetter
Date:
Subject: Re: Rule appears not to fire on insert w/ "except"