From: konst583@mail.ru
To: pgsql-bugs@postgresql.org
Subject: BUG #13769: SELECT ... FROM a JOIN b FOR UPDATE a; BREAKS SNAPSHOT
Date: Wed, 11 Nov 2015 15:10:04 +0000
Message-ID: <20151111151004.2644.90192@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13769
Logged by: Konstantin Evteev
Email address: konst583@mail.ru
PostgreSQL version: 9.2.13
Operating system: Debian GNU/Linux 7.9 (wheezy)
Description:
Select of 2-nd transaction will return new value from a and old value from
b
CREATE TABLE a
(
id integer,
val1 integer
);
CREATE TABLE b
(
id integer,
val1 integer
);
insert into a select 1,2;
insert into b select 1,3;
--FIRST TRANSACTION
begin
select * from a inner join b
on
a.id = b.id
where
a.id =1 for update of a;
update a set val1 = 0 where id = 1;
update b set val1 =0 where id = 1;
end
-- SECOND TRANSACTION (starts during executing of first transaction)
select * from a
inner join
b on a.id = b.id
where a.id =1 for update of a
--result:
1;0;1;3
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: konst583@mail.ru
Subject: Re: BUG #13769: SELECT ... FROM a JOIN b FOR UPDATE a; BREAKS SNAPSHOT
In-Reply-To: <20151111151004.2644.90192@wrigleys.postgresql.org>
References: <20151111151004.2644.90192@wrigleys.postgresql.org>
* 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