Re: Review of Writeable CTE Patch

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Review of Writeable CTE Patch
Date: 2010-02-03 09:09:41
Message-ID: 4B693D55.6000408@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2010-02-03 11:04 UTC+2, Takahiro Itagaki wrote:
> Hi, I'm reviewing the writable CTE patch. The code logic seems to be
> pretty good, but I have a couple of comments about error cases:
>
> * Did we have a consensus about user-visible "DML WITH" messages?
> The term is used in error messages in many places, for example:
> "DML WITH without RETURNING is only allowed inside an unreferenced CTE"
> Since we don't use "DML WITH" nor "CTE" in documentation,
> I'd like to avoid such technical acronyms in logs if we had better names,
> or we should have a section to explain them in docs.

We have yet to reach a consensus on the name for this feature. I don't
think we have any really good candidates, but I like "DML WITH" best so far.

> * What can I do to get "Recursive DML WITH statements are not supported"
> message? I get syntax errors before I get the message because We don't
> support UNIONs with RETURNING queries. Am I missing something?
>
> =# UPDATE tbl SET i = i + 1 WHERE i = 1
> UNION ALL
> UPDATE tbl SET i = i + 1 WHERE i = 2;
> ERROR: syntax error at or near "UNION"

WITH RECURSIVE t AS (INSERT INTO foo SELECT * FROM t) VALUES(true);
would do that. You can do the same with UPDATE .. FROM and DELETE .. USING.

> * The patch includes regression tests, but no error cases in it.
> More test cases are needed for stupid queries.

Ok, I'll add these and send an updated patch in a few hours.

Regards,
Marko Tiikkaja

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2010-02-03 09:34:07 Re: Listen / Notify - what to do when the queue is full
Previous Message Takahiro Itagaki 2010-02-03 09:04:32 Re: Review of Writeable CTE Patch