data modifying WITH seems to drop rows in cascading updates -- bug?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема data modifying WITH seems to drop rows in cascading updates -- bug?
Дата
Msg-id CAHyXU0xibzCj+zOGF87-mcpTpD=tBYoHFyKZimRio3pM8YZsuw@mail.gmail.com
обсуждение исходный текст
Ответы Re: data modifying WITH seems to drop rows in cascading updates -- bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclared identifier 'FD_SETSIZE'
Следующее
От: Tom Lane
Дата:
Сообщение: Re: data modifying WITH seems to drop rows in cascading updates -- bug?