From:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To:
Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc:
Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>,
PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: top-level DML under CTEs
Date:
2010-09-14 23:02:25
Message-ID:
19924.1284505345@sss.pgh.pa.us (view raw or flat )
Thread:
2010-09-13 13:15:24 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-13 13:20:19 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-13 18:43:18 from Merlin Moncure <mmoncure(at)gmail(dot)com>
2010-09-13 19:14:49 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-14 00:44:46 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-14 15:50:31 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-09-14 18:59:43 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-14 19:51:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-14 20:28:33 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-09-14 22:49:29 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-14 23:02:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-15 01:15:12 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-15 03:22:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-15 04:38:17 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-17 01:48:35 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-22 23:59:15 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-09-23 06:12:51 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-23 09:22:54 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-09-29 19:14:07 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-10-01 08:24:23 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-03 13:47:28 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-04 11:46:23 from "Erik Rijkers" <er(at)xs4all(dot)nl>
2010-10-04 21:59:07 from Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
2010-10-05 01:49:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-15 01:04:06 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Lists:
pgsql-hackers pgsql-rrreviewers
Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2010-09-14 10:51 PM, Tom Lane wrote:
>> My recollection is that whether a CTE is marked RECURSIVE or not affects
>> its scope of visibility, so that confusing the two cases can result in
>> flat-out incorrect parser behavior.
> The worst I can think of is:
> CREATE TABLE foo(a int);
> WITH t AS (SELECT * FROM foo)
> INSERT INTO bar
> WITH RECURSIVE foo (SELECT 1 AS a)
> SELECT * FROM t;
> t will actually be populated with the results of the CTE, not the table foo.
> I don't think this is a huge problem in real life, but if someone thinks
> otherwise, I think we could just error out if the lists have a different
> RECURSIVE definition.
Wrong is wrong. Doesn't matter whether it's "a huge problem in real life".
Why is it so difficult to do this correctly?
regards, tom lane
In response to
Responses
pgsql-hackers by date
Next :From: Tom LaneDate: 2010-09-14 23:26:26
Subject : Re: Pseudoconstant quals versus the join removal patch
Previous :From : Robert HaasDate : 2010-09-14 22:49:29
Subject : Re: top-level DML under CTEs
pgsql-rrreviewers by date
Next :From: Hitoshi HaradaDate: 2010-09-15 01:04:06
Subject : Re: top-level DML under CTEs
Previous :From : Robert HaasDate : 2010-09-14 22:49:29
Subject : Re: top-level DML under CTEs