Re: top-level DML under CTEs

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

> Does that cause surprising behavior?

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.

It would probably be all right to combine the cases internally, at the
rewriter or planner stage.  It's not okay to do it in the parser, not
even after doing parse analysis of the individual CTEs, because then it
would be impossible for ruleutils.c to reverse-list the query correctly.
        regards, tom lane


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Serializable Snapshot Isolation
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: top-level DML under CTEs