Update doesnt process the changes

From: "Zakharov, Andrey" <AZakharov(at)luxoft(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Update doesnt process the changes
Date: 2017-05-19 10:57:51
Message-ID: 3F693CCDF87C9742826D43FFF9F366BEAF18E26A@oro-mbox-02.luxoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello colleagues -

Could you please help me in this situation which I cannot understand:

SELECT version();

>> PostgreSQL 9.5.0, compiled by Visual C++ build 1800, 64-bit

create table apps as select /*...*/;

>> Table created.

select rnum, app_birth_country_id, app_birth_country from apps where rnum in (6609,1047336);

>>

rnum

app_birth_country_id

app_birth_country

6609

1033302

KAZ

1047336

1033343

UZB

create temporary table tmp_Common(id int8, val varchar(254), val1 varchar(254)) on commit drop;

>> Table created.

-- fix birth country
insert into tmp_Common(id,val,val1) values
(36248,'1033343','UZB'),
(1080979,'1033396','TJK'),
(1047336,'1033343','UZB'),
(159885,'1033605','KGZ'),
(6609,'1033302','KAZ'),
(106775,'1033258','UKR'),
(224993,'1033258','UKR'),
(127388,'1033322','MDA'),
(313374,'1033362','RUS'),
(145361,'1033289','GEO'),
(209934,'1033431','ARM'),
(33522,'1033362','RUS'),
(31422,'1033362','RUS'),
(159885,'1033604','KGZ'),
(1325984,'1033604','KGZ'),
(6609,'1033302','KAZ'), -- this row is shown in the sample
(1047336,'1033302','KAZ') -- this row is shown in the sample
;

>> 17 rows inserted

update
apps
set
app_birth_country_id = a.val::int8,
app_birth_country = a.val1
from (
select
id,
val,
val1
from
tmp_Common
) a
where
apps.rnum = a.id
;

>> 14 rows updated.

select rnum, app_birth_country_id, app_birth_country from apps where rnum in (6609,1047336);

>>

rnum

app_birth_country_id

app_birth_country

6609

1033302

KAZ

1047336

1033343

UZB

Values for rnum = 6609 kept unchanged. It's OK. But for 1047336 the ones kept unchanged either. It's not expected. Making table tmp_Common permanently doesn't help.

Could you give me a clue - I'm doing something wrong or it's bug?

PostgreSQL version is installed on Win7 Enterprise.

Thanx.
Andrew Zakharov
Leading Database Architect
Luxoft

Tel: +7 495 967 8030

[cid:image001(dot)gif(at)01D2D0A6(dot)A33D2E50]
Luxoft Holding (NYSE:LXFT) is a leading provider of software development services and innovative IT solutions to a global client base consisting primarily of large multinational corporations. Headquartered in Zug, Switzerland Luxoft is listed on the New York Stock Exchange. For more information, please visit www.luxoft.com<http://www.luxoft.com>

LinkedIn: AZakharov<http://ru.linkedin.com/in/andrewzakharov/>

Follow us on: [cid:image002(dot)gif(at)01D2D0A6(dot)A33D2E50] <http://www.linkedin.com/company/luxoft> [cid:image003(dot)gif(at)01D2D0A6(dot)A33D2E50] <http://twitter.com/Luxoft> [cid:image004(dot)gif(at)01D2D0A6(dot)A33D2E50] <http://www.youtube.com/channel/UCDtOIqWxKHTdtmVi8yr_D7Q> [cid:image005(dot)gif(at)01D2D0A6(dot)A33D2E50] <https://www.facebook.com/Luxoft> [cid:image006(dot)gif(at)01D2D0A6(dot)A33D2E50] <https://plus.google.com/109881160058685562700>

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

________________________________

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2017-05-19 12:31:15 Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Ashutosh Bapat 2017-05-19 10:07:59 Re: Re: [BUGS] BUG #14657: Server process segmentation fault in v10, May 10th dev snapshot