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 1viGbB-001x7j-2S for pgsql-general@arkaria.postgresql.org; Tue, 20 Jan 2026 18:37:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viGbA-002Krf-1v for pgsql-general@arkaria.postgresql.org; Tue, 20 Jan 2026 18:37:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viGbA-002KrX-0k for pgsql-general@lists.postgresql.org; Tue, 20 Jan 2026 18:37:04 +0000 Received: from pmg-1.outbound.snap.net.nz ([202.37.100.99]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viGb7-001ZLI-1d for pgsql-general@lists.postgresql.org; Tue, 20 Jan 2026 18:37:04 +0000 Received: from pmg-1.snap.net.nz (localhost.localdomain [127.0.0.1]) by pmg-1.snap.net.nz (Proxmox) with ESMTP id 59CC22B5F1F for ; Wed, 21 Jan 2026 07:36:54 +1300 (NZDT) Received: from smtp.snap.net.nz (smtp.snap.net.nz [202.37.100.140]) by pmg-1.snap.net.nz (Proxmox) with ESMTP id 0005E26D0BD for ; Wed, 21 Jan 2026 07:36:52 +1300 (NZDT) Received: from x24.msqr.us (msqr.us [123.255.47.99]) by rupert.snap.net.nz (Postfix) with ESMTPS id EC7DDEB for ; Wed, 21 Jan 2026 07:36:52 +1300 (NZDT) Received: from smtpclient.apple (unifi.localdomain [192.168.1.1]) (authenticated bits=0) by x24.msqr.us (8.18.1/8.16.1) with ESMTPSA id 60KIaq2N077399 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 21 Jan 2026 07:36:52 +1300 (NZDT) (envelope-from postgresql.org@msqr.us) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=msqr.us; s=20121026; t=1768934212; bh=cRRfucgIkD5ulwoHIIvJLgRo1ygwbXxo3u9IeD/UpXg=; h=From:Subject:Date:To; b=kYfOOfU3aZ0wGrOWnVhV8LufVN7e93qVsk+xBczDlS8q3AIj2Skg/Q3oirPnIKGtk IU8al3erhNrt4Qf56hDiYcXC+IK2LmD91RvPAe+RyxTeAB0rGCIh6OI9hBOpIZP63I 3pwnSr1fubpqHJv4hLLKabJeieKzzARvfKqiiUKk= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 1.5.1 at msqr.us From: Matt Magoffin Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.4\)) Subject: Collation with upper and numeric comparing in unexpected way Message-Id: <9EBA273E-7F3C-40F4-8156-745A4BB5B090@msqr.us> Date: Wed, 21 Jan 2026 07:36:42 +1300 To: pgsql-general@lists.postgresql.org X-Mailer: Apple Mail (2.3826.700.81.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I am using Postgres 17 and trying to configure a collation that sorts = upper case before lower case and includes numeric sorting: CREATE COLLATION testsort (provider =3D icu, locale =3D = 'und-u-kf-upper-kn=E2=80=99); These comparisons are working as I expected: SELECT 'id-45' < 'id-123' COLLATE testsort; -- true (45 before 123) SELECT 'id' < 'ID' COLLATE testsort; -- false (upper case before lower = case) However combining them resulted in an unexpected result: SELECT 'id-45' < 'ID-123' COLLATE testsort; -- true I thought that last one would be false because =E2=80=9CID=E2=80=9D = would come before =E2=80=9Cid=E2=80=9D. Is there a way to configure the = collation to achieve that? I=E2=80=99m trying to match the sorting = behaviour in external application code. Thanks for any help, Matt