From: bobby.rullo@coreos.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13524: Not Getting expected Serialization error
Date: Tue, 28 Jul 2015 20:45:30 +0000
Message-ID: <20150728204530.25042.78768@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: 13524
Logged by: Robert Rullo
Email address: bobby.rullo@coreos.com
PostgreSQL version: 9.4.1
Operating system: Mac OS X
Description:
Because this requires concurrent transactions, we will consider two
different sequences of SQL statements, each to be executed in PSQL against
the same database.
Sequence 1:
=========
drop table if exists "t1";
create table if not exists "t1" ("id" text not null primary key, "name"
text, "email" text) ;
begin;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
select count(*) from "t1" where email = 'bill@example.com';
insert into "t1" ("id","name","email") values
('1','bill','bill@example.com');
-- EXECUTE sequence1.txt HERE
commit;
Sequence 2:
==========
begin;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--select count(*) from "t1" where email = 'bill@example.com'; --UNCOMMENT
ME LATER
insert into "t1" ("id","name","email") values
('2','william','bill@example.com');
commit;
To reproduce:
1) execute statements in sequence 1 on a connection, stopping at the
"--EXECUTE" statement.
2) In another connection, execute all the statements in Sequence 2.
3) Back in the first connection execute the remaining statement (the
"commit;")
Expected:
error when trying to commit, eg. "ERROR: could not serialize"
Actual:
Both commits succeed.
Interesting tidbit:
If you do the exact steps as above but uncomment the "select count(*)" in
sequence 2, you get the expected error.
--
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: bobby.rullo@coreos.com
Subject: Re: BUG #13524: Not Getting expected Serialization error
In-Reply-To: <20150728204530.25042.78768@wrigleys.postgresql.org>
References: <20150728204530.25042.78768@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