From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Fritz Lehmann-Grube <lehmannf@math.TU-Berlin.DE>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: ERROR (Bug?) in RULE processing ?
Date: Thu, 7 Mar 2002 20:29:49 -0500 (EST)
Message-ID: <200203080129.g281Top00972@candle.pha.pa.us> (raw)
In-Reply-To: <2799.1011801628@sss.pgh.pa.us>
I see the query:
arbeitsdb=# CREATE RULE doc_contained AS ON INSERT TO documents WHERE
arbeitsdb-# ((NEW.type = 1) AND (count( (SELECT element_id
arbeitsdb(# FROM element_contained_in WHERE (element_id =
currval('docs_seq')) )) = 0))
arbeitsdb-# DO INSTEAD NOTHING;
Added to TODO:
* Prevent aggregates from being used in rule WHERE clauses
Also, please try using HAVING with count() and see if that helps.
---------------------------------------------------------------------------
Tom Lane wrote:
> Fritz Lehmann-Grube <lehmannf@math.TU-Berlin.DE> writes:
> > Can somebody tell what this errormessage means ?
> > ERROR: fireRIRrules: failed to remove aggs from qual
>
> The reason it's such an unfriendly error message is that it's an
> internal "shouldn't ever happen" check.
>
> What you actually did wrong was to use an aggregate function (count())
> in the rule's WHERE clause. This should have been rejected much further
> upstream, like when you tried to create the rule. That error test
> doesn't seem to be there now though :-(
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
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: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, lehmannf@math.TU-Berlin.DE
Subject: Re: ERROR (Bug?) in RULE processing ?
In-Reply-To: <200203080129.g281Top00972@candle.pha.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