Re: Writeable CTE patch - Mailing list pgsql-hackers

From Alex Hunsaker
Subject Re: Writeable CTE patch
Date
Msg-id 34d269d40911291438p65bc85deg280a6a508b3e65bc@mail.gmail.com
Whole thread Raw
In response to Re: Writeable CTE patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Nov 28, 2009 at 11:59, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 1. I thought we'd agreed at
> http://archives.postgresql.org/pgsql-hackers/2009-10/msg00558.php
> that the patch should support WITH on DML statements, eg
>        with (some-query) insert into foo ...
> This might not take much more than grammar additions, but it's
> definitely lacking at the moment.

Hrm ? A few messages down you say SELECT should be a good start

http://archives.postgresql.org/pgsql-hackers/2009-10/msg01081.php

> 2. The handling of rules on DML WITH queries is far short of sufficient.

Ick.

> Perhaps it would be acceptable to just throw ERROR_FEATURE_NOT_SUPPORTED
> when there are DO ALSO or conditional DO INSTEAD rules applying to the
> target of a DML WITH query.

+1

> 3. I'm pretty unimpressed with the code added to ExecutePlan.
> I wonder whether it would be practical to fix both #2 and #3 by having the
> representation of DML WITH queries look more like the representation of
> rule rewrite output

Interesting...  This seems like the best solution ( assuming its
workable ).  It also looks like it might make #1 easier as well.

However, I think the current approach does have some virtue in that I
was surprised how little the patch was.  Granted that is partly due to
ExecutePlan knowing to much.


pgsql-hackers by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: plperl and inline functions -- first draft
Next
From: Tom Lane
Date:
Subject: Re: Application name patch - v4