"with recursive" ignores side effects?

Поиск
Список
Период
Сортировка
От Fabien
Тема "with recursive" ignores side effects?
Дата
Msg-id alpine.DEB.2.02.1308062030390.29999@localhost6.localdomain6
обсуждение исходный текст
Ответы Re: "with recursive" ignores side effects?  (David Johnston <polobo@yahoo.com>)
Список pgsql-bugs
I have an unexpected issue with a side effects on a table which is ignored
by a recursive query. I've tried to simplify the issue to a simple
example, see the attached sql script.

Version 1 results in:

   it / fid / stuff / foo full contents
   0 | 0 |       | {1:one,2:two}
   1 | 1 | one   | {1:one,2:*}
   2 | 2 | two   | {1:*,2:*}

The key issue for me is that table Foo is updated (as shown by the last
column), but although 'two' was updated to '*' by iteration 1, the last
iteration still sees the initial 'two' which does not exist anymore.

Version 2 illustrates more or less the behavior I would have expected.
I've read again Section 7.8 about WITH queries, but I have not seen
anything that would disprove my expectation.

Am I wrong somewhere? Or is this a subtle bug?

--
Fabien.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #8367: wrong example in 8.17.10
Следующее
От: David Johnston
Дата:
Сообщение: Re: "with recursive" ignores side effects?