agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: syzhong16@gmail.com
Subject: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation
Date: Thu, 20 Aug 2026 03:49:53 +0000
Message-ID: <19633-647cd4c73a84b085@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19633
Logged by: Suyang Zhong
Email address: syzhong16@gmail.com
PostgreSQL version: 19beta3
Operating system: Ubuntu 22.04
Description:
Hi,
Consider the following test case:
```
CREATE COLLATION ci (provider = icu, locale = 'und-u-ks-level1',
deterministic = false);
CREATE TABLE t_lhs(c1 text COLLATE ci);
CREATE TABLE t_rhs(c0 text);
INSERT INTO t_lhs VALUES ('a'), ('x'), ('y');
INSERT INTO t_rhs VALUES ('a'), ('a');
ANALYZE t_lhs;
ANALYZE t_rhs;
INSERT INTO t_rhs VALUES ('A');
SELECT c1, c1 IN (SELECT c0 FROM t_rhs) AS p FROM t_lhs;
-- a | t
-- x | f
-- y | f
SELECT count(*) FROM t_lhs WHERE c1 IN (SELECT c0 FROM t_rhs);
-- Expected: 1, Actual: 2
```
The predicate evaluates to true for one row, so filtering on the same
predicate should return one row.
Reproduced on 20devel and 19beta3.
view thread (13+ messages) latest in thread
Message-ID: <19633-647cd4c73a84b085@postgresql.org>
Permalink: ../19633-647cd4c73a84b085@postgresql.org/
Also on: postgresql.org/message-id/19633-647cd4c73a84b085@postgresql.org
reply
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, syzhong16@gmail.com
Subject: Re: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation
In-Reply-To: <19633-647cd4c73a84b085@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox