"with recursive" ignores side effects? - Mailing list pgsql-bugs

From Fabien
Subject "with recursive" ignores side effects?
Date
Msg-id alpine.DEB.2.02.1308062030390.29999@localhost6.localdomain6
Whole thread Raw
Responses Re: "with recursive" ignores side effects?
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #8367: wrong example in 8.17.10
Next
From: David Johnston
Date:
Subject: Re: "with recursive" ignores side effects?