data modifying WITH seems to drop rows in cascading updates -- bug? - Mailing list pgsql-bugs

From Merlin Moncure
Subject data modifying WITH seems to drop rows in cascading updates -- bug?
Date
Msg-id CAHyXU0xibzCj+zOGF87-mcpTpD=tBYoHFyKZimRio3pM8YZsuw@mail.gmail.com
Whole thread Raw
Responses Re: data modifying WITH seems to drop rows in cascading updates -- bug?
List pgsql-bugs
Hackers,

Trying to figure out if this is undefined behavior of a bug. It's
confusing, and I'm aware of certain oddities in the fringes of the
data modifying with queries where the query dependencies are not
really clear.  Why does the query only return one row?

postgres=# create table foo(id int);
CREATE TABLE
postgres=# insert into foo values(1);
INSERT 0 1
postgres=# with a as (update foo set id = id + 1 returning *), b
as(update foo set id = id + 1 returning * ) select * from a union all
select id from b;
 id
────
  2
(1 row)

postgres=# select version();
                                                 version
─────────────────────────────────────────────────────────────────────────────────────────────────────────
 PostgreSQL 11.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5
20150623 (Red Hat 4.8.5-28), 64-bit
(1 row)

merlin

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclared identifier 'FD_SETSIZE'
Next
From: Tom Lane
Date:
Subject: Re: data modifying WITH seems to drop rows in cascading updates -- bug?