Unexpected serialization error - Mailing list pgsql-bugs

From Luka Žitnik
Subject Unexpected serialization error
Date
Msg-id CAEXuP_U743JdQxnPXL7xWu9ODyY0Xz2wnO0O_nokQnb++foswg@mail.gmail.com
Whole thread Raw
Responses Re: Unexpected serialization error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi guys,

I had no luck over at general slack channel. So I'm beginning to treat this as a bug. Here's a test case that unexpectedly fails at last insert. I expect it not to fail because the rows that the two transactions act on are unrelated to one another.

CREATE TABLE t1 (    class integer NOT NULL
);

CREATE INDEX ON t1 (class);

CREATE TABLE t2 (    class integer NOT NULL
);

CREATE INDEX ON t2 (class);

ALTER SYSTEM SET enable_seqscan TO off;

-- Session 1
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT * FROM t2 WHERE class=1;

-- Session 2
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT * FROM t1 WHERE class=2;
INSERT INTO t2 VALUES(2);
COMMIT;

-- Session 1
INSERT INTO t1 VALUES(1);
COMMIT;
Postgres version is PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit.

-- Lule

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16862: Unexpected result of checking for null "IS NOT NULL" in function
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #16862: Unexpected result of checking for null "IS NOT NULL" in function