Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wx7i2-002S3c-2N for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Aug 2026 18:41:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wx7i1-009hxB-1O for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Aug 2026 18:41:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwtn5-0075fJ-0r for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 03:50:07 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwtn3-00000001Uw5-2gtp for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 03:50:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=qU0X1NJCl7FFACu27xaYNDUuPbiL/SSvnm3dgzt6p/M=; b=vXZnDrdIz0jLZ0goOYPGWHt3e9 IpxDzomQF+uWN2P/Idl5xF51QYv8RiVDRG35s4KQpLvjkIZLcoQImscKApHr78dH+8/BU0VQ688dw wY0kBZo/XkTV6AJw9sqkPEGQeSL4bc8pIQDTEhzyJlXcGxWyHFkmfLqfLPRbVRsBHLEclgy5AfpM1 CN9SzVpeuQ+WTAbL3hgGOfAbKnWqHqhxltH7f0gAhC9mSSuFYMIJT+A2FZy5WBqHZfi+b0cVpmwi6 wsk8F+r9elhytd8kuGKNWdHGDwAgD8L28VnH9cV90gg0VJIE0hqMcZoBb0rGU49f/qSbay6b0Uu7/ z/sHjX3w==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwtn3-004YUy-1J for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 03:50:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1wwtn1-0000000CGGs-3rti for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 03:50:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: syzhong16@gmail.com Reply-To: syzhong16@gmail.com, pgsql-bugs@lists.postgresql.org Date: Thu, 20 Aug 2026 03:49:53 +0000 Message-ID: <19633-647cd4c73a84b085@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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: =20 Hi, Consider the following test case: ``` CREATE COLLATION ci (provider =3D icu, locale =3D 'und-u-ks-level1', deterministic =3D 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.