Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iI6UX-0001cX-Rb for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 07:34:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iI6UW-0000IK-NX for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 07:34:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iI6UW-0000IB-DW for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 07:34:36 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iI6UT-0007Aw-TD for pgsql-general@postgresql.org; Wed, 09 Oct 2019 07:34:36 +0000 Received: by mail-wr1-x443.google.com with SMTP id n14so1425449wrw.9 for ; Wed, 09 Oct 2019 00:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=lgBFZgcwFsSrTfl2MH7IRLtMIrSBExL96uTpnoj3LSI=; b=uBlqw9GX7eSaPEPgoKChiVNbVQucSRTk3HlQNvdw2eSTRP8f5/vLL/0C72u/LxDM9V /7G5+A1XEjKJqI8TwbP1NgNhhIYKAkjyAG4ivDmfwM6mT0aqLoKLLsGZpdPtdzHZWlet YcVOjp5a6GpSNmc5CmKwz71Q7UcRVhRMReHpzhbplgoHw+mLtAPmFbTdlzfdJHfmLplX CndesK8GuBZpIAai0ScPkU9VkBk3o+l1UEEeTIWqDX/Ev2yZ+mMaJ1rVmu9LFW/oE1rX //MRv59i0lXuYFJzkfwJ3eHyK9cwMHzNOwZ5V18c+DZppKp0rx3BkIVDB5GC4mbImdxQ Tv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=lgBFZgcwFsSrTfl2MH7IRLtMIrSBExL96uTpnoj3LSI=; b=A7qSYs+4ed7M8xxtNuvxdbLqxrsH5a42tWWpg+qL2T9SbuYfvc0QlV1VX3bjmSrweF +31p/EBElWC0yK6bLNvpXWr5zzt5YRMivYjK0TjsjiR0g23wPlKrYUBQgFLma+tJlhBe CeD4Nmdx5txdlrI4Oc37WcHoUGnF+FEWKV3/xqSXSxhB1UxN64qj0dC/z99Ns7KDwHn3 RRaNKFWQl+8IcjXmqMm1Awf7TVStDO37Lg/HfGvgQ4QBze2qQeDJDA9ZHBp2ca/Oe80d yG/EIvthzsZAHzz5CvGoJQaB0ciwRAzv5ReaxZK0B47Pe0g/Ri3TfAp9ZCCXTBAhKe8q Dp1Q== X-Gm-Message-State: APjAAAX7KAjFWlogwaiad/pQz8goUlm5I5Pya3c8CEBH48fVXnc3qGpD rPUK+IskorssBNMjrS6e9ZlhAw== X-Google-Smtp-Source: APXvYqwwW5K/V3ziU//bHAb16T7hzL7wqfoN0w6xHTzNejzGewuqwOkSTl5Me9MKTpg2qCcqAKWaUw== X-Received: by 2002:adf:e90d:: with SMTP id f13mr1665599wrm.104.1570606472659; Wed, 09 Oct 2019 00:34:32 -0700 (PDT) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id r20sm1622626wrg.61.2019.10.09.00.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 00:34:32 -0700 (PDT) Message-ID: <9ad4f42faa10f1aa4e81e3ed8160d36d0d39856a.camel@cybertec.at> Subject: Re: Case Insensitive Comparison with Postgres 12 From: Laurenz Albe To: Igal Sapir , "Psql_General (E-mail)" Date: Wed, 09 Oct 2019 09:34:31 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Igal Sapir wrote: > I am trying to test a simple case insensitive comparison. Most likely the > collation that I chose is wrong, but I'm not sure how to choose the correct > one (for English/US?). Here is my snippet: > > create collation case_insensitive( > provider=icu, locale='en-US-x-icu', deterministic=false > ); > select 'Abc' = 'abc' collate case_insensitive; > > I expected true but am getting false. > > Any thoughts? Yes, the LOCALE is wrong. Use create collation case_insensitive ( provider=icu, locale='en-US-u-ks-level2', deterministic=false ); The name of the locale defines it. My blog post can give a simple introduction: https://www.cybertec-postgresql.com/en/icu-collations-against-glibc-2-28-data-corruption/ Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com