From: Zakharov, Andrey <AZakharov@luxoft.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Update doesnt process the changes
Date: Fri, 19 May 2017 10:57:51 +0000
Message-ID: <3F693CCDF87C9742826D43FFF9F366BEAF18E26A@oro-mbox-02.luxoft.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.gif@01D2D0A6.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.gif@01D2D0A6.A33D2E50] <http://www.linkedin.com/company/luxoft; [cid:image003.gif@01D2D0A6.A33D2E50] <http://twitter.com/Luxoft; [cid:image004.gif@01D2D0A6.A33D2E50] <http://www.youtube.com/channel/UCDtOIqWxKHTdtmVi8yr_D7Q; [cid:image005.gif@01D2D0A6.A33D2E50] <https://www.facebook.com/Luxoft; [cid:image006.gif@01D2D0A6.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.
Attachments:image001.gif (image/gif, 1.5K) downloadview imageimage002.gif (image/gif, 1.7K) downloadview imageimage003.gif (image/gif, 1.4K) downloadview imageimage004.gif (image/gif, 2.3K) downloadview imageimage005.gif (image/gif, 1.5K) downloadview imageimage006.gif (image/gif, 1.7K) downloadview image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: AZakharov@luxoft.com
Subject: Re: Update doesnt process the changes
In-Reply-To: <3F693CCDF87C9742826D43FFF9F366BEAF18E26A@oro-mbox-02.luxoft.com>
References: <3F693CCDF87C9742826D43FFF9F366BEAF18E26A@oro-mbox-02.luxoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox