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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to