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.94.2) (envelope-from ) id 1tvHB4-00313z-GL for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Mar 2025 14:47:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tvHA4-002gB4-Pf for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Mar 2025 14:46:20 +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.94.2) (envelope-from ) id 1tvHA4-002gAw-H8 for pgsql-bugs@lists.postgresql.org; Thu, 20 Mar 2025 14:46:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tvHA2-0009ND-0K for pgsql-bugs@lists.postgresql.org; Thu, 20 Mar 2025 14:46:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52KEkFen985481; Thu, 20 Mar 2025 10:46:16 -0400 From: Tom Lane To: 2322370369@qq.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18857: Abnormal string comparison results In-reply-to: <18857-a9354c81af5b800d@postgresql.org> References: <18857-a9354c81af5b800d@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 20 Mar 2025 09:53:32 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <985479.1742481975.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 20 Mar 2025 10:46:15 -0400 Message-ID: <985480.1742481975@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > As shown in the example below, on the ASCII table =E2=80=98?=E2=80=99 is= larger than =E2=80=98&=E2=80=99. I > don't think =E2=80=98t=E2=80=99 should be returned here. In the MySQL da= tabase it does > return 0. > Is there some special consideration here? Read about collations at https://www.postgresql.org/docs/current/collation.html You are probably using a non-C collation. You could say postgres=3D# SELECT ('?' <=3D '&*CcCV5' collate "C"); ?column? = ---------- f (1 row) but more likely you want to switch it at the database level. regards, tom lane