Unexpected update behaviour

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Unexpected update behaviour
Date: 2013-12-13 22:16:51
Message-ID: CAGnEboiorcnbvNwNqV+mS1rALG9DjE_SL44bUjOCbx8Lkw_+Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings.

I've hit a strange issue. This is a simplified setup.
First, run create.sql to get a couple of tables.
Then, run the update query.

Tested on 9.2.6 and 9.3.2.

Now:
- if I remove the UNION ALL part of the inner query, UPDATE works;
- if I move the `raw` subquery into the CTE, UPDATE works (but takes
hours on my full data);
- if I convert this UPDATE into a SELECT, I get the row to be updated.

Could you kindly explain me why the query as it is updates no records?

--
Victor Y. Yegorov

Attachment Content-Type Size
create.sql application/octet-stream 1.8 KB
update.sql application/octet-stream 836 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2013-12-13 23:38:02 Re: Data Guard for Postgres?
Previous Message Roy Anderson 2013-12-13 21:57:00 Data Guard for Postgres?