Re: top-level DML under CTEs

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: top-level DML under CTEs
Дата
Msg-id AANLkTim4rdhh1u9rvxvfi8xnXRMJ0ZM_JMdZfX4RjwVz@mail.gmail.com
обсуждение исходный текст
Ответ на Re: top-level DML under CTEs  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Список pgsql-hackers
2010/9/15 Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>:
> 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.

Hmmm, that's true. But it seems unrelated to RECURSIVE option, right?

Regards,



-- 
Hitoshi Harada


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Pseudoconstant quals versus the join removal patch
Следующее
От: Hitoshi Harada
Дата:
Сообщение: Re: top-level DML under CTEs