Skip site navigation (1) Skip section navigation (2)

Re: top-level DML under CTEs

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: top-level DML under CTEs
Date: 2010-09-14 15:50:31
Message-ID: 4C8F99C7.5020103@cs.helsinki.fi (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
On 2010-09-13 4:15 PM +0300, Hitoshi Harada wrote:
> 1. WITH clause atop INSERT
> Although the previous discussion got the consensus that we forbid WITH
> atop INSERT, it seems to me that it can be allowed. I managed to do it
> by treating the top WITH clause (of INSERT) as if the one of SELECT
> (or VALUES).

In the email you referred to, Tom was concerned about the case where 
these WITH lists have different RECURSIVE declarations.  This patch 
makes both RECURSIVE if either of them is.  I can think of cases where 
that might lead to surprising behaviour, but the chances of any of those 
happening in real life seem pretty slim.

 > It is possible to disallow the CTE over INSERT statement,
> but the lack for INSERT, though there are for UPDATE and DELETE,
> sounds inconsistent enough.

Also because wCTEs are not allowed below the top level, not being able 
to use INSERT as the top level statement would force people to wrap that 
INSERT in another CTE.



Regards,
Marko Tiikkaja

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-09-14 15:56:37
Subject: Re: Report: removing the inconsistencies in our CVS->git conversion
Previous:From: Robert HaasDate: 2010-09-14 15:49:57
Subject: Re: Report: removing the inconsistencies in our CVS->git conversion

pgsql-rrreviewers by date

Next:From: Hitoshi HaradaDate: 2010-09-14 18:59:43
Subject: Re: top-level DML under CTEs
Previous:From: Hitoshi HaradaDate: 2010-09-14 00:44:46
Subject: Re: top-level DML under CTEs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group