Re: Writeable CTEs patch

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Writeable CTEs patch
Date: 2010-02-05 05:14:30
Message-ID: 20100205141427.9C07.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> wrote:

> Here's an updated patch. Only changes from the previous patch are
> fixing the above issue and a regression test for it.

A brief report for of the patch:

* The patch has the following error cases, and also have one regression
test for each case.

- DML WITH is not allowed in a cursor declaration
- DML WITH is not allowed in a view definition
- DML WITH without RETURNING is only allowed inside an unreferenced CTE
- DML WITH is only allowed at the top level
- Recursive DML WITH statements are not supported
^-- might be better if "DML WITH cannot have the self-reference" or so?

- Conditional DO INSTEAD rules are not supported in DML WITH statements
- DO ALSO rules are not supported in DML WITH statements
- Multi-statement DO INSTEAD rules are not supported in DML WITH statements
- DO INSTEAD NOTHING rules are not supported in DML WITH statements

* In the regression tests, almost all of them don't have ORDER BY clause.
They just work, but we might need ORDER BY to get robust output.
What did we do in other regression tests?

* I feel odd the following paragraph in the docs, but should be checked by
native English speakers.

*** a/doc/src/sgml/ref/create_rule.sgml
--- b/doc/src/sgml/ref/create_rule.sgml
***************
*** 222,227 **** CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS
--- 222,234 ----
</para>

<para>
+ In an <literal>INSERT</literal>, <literal>UPDATE</literal> or
+ <literal>DELETE</literal> query within a <literal>WITH</literal> clause,
+ only unconditional, single-statement <literal>INSTEAD</literal> rules are
^-- and? which comma is the sentence separator?
+ implemented.
^-- might be "available" rather than "implemented"?
+ </para>

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2010-02-05 05:47:04 Re: Writeable CTEs patch
Previous Message Bruce Momjian 2010-02-05 05:07:26 Re: Looking for Bill Huang; was Personal Copyright Notices