Re: BUG #13465: multi update query use CTE, result & plan not equal, BUG?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #13465: multi update query use CTE, result & plan not equal, BUG?
Дата
Msg-id CAKFQuwbWg1pT0dik8EX_QjWR+vxrxtDws9axmJuOi+==y3cnew@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #13465: multi update query use CTE, result & plan not equal, BUG?  (digoal@126.com)
Ответы Re: BUG #13465: multi update query use CTE, result & plan not equal, BUG?  (德哥 <digoal@126.com>)
Список pgsql-bugs
On Wed, Jun 24, 2015 at 1:58 AM, <digoal@126.com> wrote:

> The following bug has been logged on the website:
>

=E2=80=8BNot a bug...=E2=80=8B


PostgreSQL 9.5
> when i use CTE update t1 two times, on problem : there is diffient result=
s.
> another problem : CTE update one table two times, which query exec first,
> and how to isolation MVCC? why these result not same?
>

=E2=80=8BThe update of t1 outside of the CTE cannot see any of the changes =
made
within the CTE - which is why a RETURNING clause is required to pass
changes.

The non-CTE action effectively takes precedence=E2=80=8B.

t1(1,'abc')

WITH up AS (
UPDATE t1 SET t1.info =3D 'xyz';
)
SELECT info FROM t1; -- returns abc, not xyz

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13467: Latest Openssl library forces Postgres to Close Connections
Следующее
От: Merlin Moncure
Дата:
Сообщение: getting "ERROR: tuple concurrently updated" during concurrent grant/revoke operations (9.2.13)