From: Fabien <coelho@cri.ensmp.fr>
To: PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: "with recursive" ignores side effects?
Date: Tue, 6 Aug 2013 20:51:01 +0200 (CEST)
Message-ID: <alpine.DEB.2.02.1308062030390.29999@localhost6.localdomain6> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugsAttachments:
test.sql (application/x-sql, 1.6K) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: coelho@cri.ensmp.fr
Subject: Re: "with recursive" ignores side effects?
In-Reply-To: <alpine.DEB.2.02.1308062030390.29999@localhost6.localdomain6>
References: <alpine.DEB.2.02.1308062030390.29999@localhost6.localdomain6>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox