pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Fetter <david@fetter.org>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com>
Cc: pgsql-bugs@postgresql.org
Cc: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
Subject: Re: BUG #6051: wCTE query fail with wrong error text on a table with rules
Date: Tue, 07 Jun 2011 00:11:46 -0400
Message-ID: <2864.1307419906@sss.pgh.pa.us> (raw)
In-Reply-To: <20110606164101.GA25901@fetter.org>
References: <201106031542.p53FgDh5073991@wwwmaster.postgresql.org>
	<BANLkTim4L2q_4DC4xc1J5YuEprbBFfZ3mg@mail.gmail.com>
	<4184.1307222662@sss.pgh.pa.us>
	<20110606164101.GA25901@fetter.org>

David Fetter <david@fetter.org> writes:
> On Sat, Jun 04, 2011 at 05:24:22PM -0400, Tom Lane wrote:
>> We could paste a copy of the original's cteList into the rule action,
>> but there are still issues:
>> 
>> * If there's more than one rule action, we could end up executing
>> multiple copies of the same CTE query; which breaks the expectation
>> of single evaluation for a CTE.
>> 
>> * If there are CTEs attached to the rule action, as well as to the
>> original query, and there is a conflict of CTE names between them,
>> we can't handle that AFAICS.  (The planner expects to look up entries
>> in a cteList by name...)
>> 
>> * Maybe some other things that aren't obvious yet.
>> 
>> I don't particularly mind throwing a not-implemented error for the first
>> case (ie, just say multiple rule actions don't mix with CTE queries);

> Great :)

>> but the second case seems seriously annoying, since there's no way
>> for someone to write a CTE-containing rule action without risking a
>> conflict.  Ideas anybody?

> Is there some way to throw "not implemented" there, too?  It seems to
> me that making accommodations for the user-modifiable part of our
> rewrite rules isn't the right direction to go, as we're well on our
> way to phasing the user-modifiable part out.

Yes, we certainly can throw an error for that, it's just going to be a
pain from a usability standpoint.  But I agree that the number of people
affected might be small, so it's not worth doing a significant rewrite
for right now.

I've committed a patch along these lines.

			regards, tom lane



view thread (5+ messages)

Message-ID: <2864.1307419906@sss.pgh.pa.us>
Permalink:  ../2864.1307419906@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2864.1307419906@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david@fetter.org, mmoncure@gmail.com, jgdr@dalibo.com, marko.tiikkaja@cs.helsinki.fi
  Subject: Re: BUG #6051: wCTE query fail with wrong error text on a table with rules
  In-Reply-To: <2864.1307419906@sss.pgh.pa.us>
  References: <201106031542.p53FgDh5073991@wwwmaster.postgresql.org> <BANLkTim4L2q_4DC4xc1J5YuEprbBFfZ3mg@mail.gmail.com> <4184.1307222662@sss.pgh.pa.us> <20110606164101.GA25901@fetter.org> <2864.1307419906@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