Re: case insensitive collation of Greek's sigma

2021-12-02 Thread Gianni Ceccarelli
I realise this may not be applicable to the original problem, but non-deterministic collations seems to offer a solution:: dakkar@[local] dakkar=> create collation "en-US-ins-icu" ( provider=icu, locale='en-US-u-ks-level2', deterministic=false ); dakkar@[l

Re: case insensitive collation of Greek's sigma

2021-12-02 Thread Jakub Jedelsky
On Wed, Dec 1, 2021 at 8:49 PM Tom Lane wrote: > Peter Eisentraut writes: > > Running lower() like this is really the wrong thing to do. We should be > > doing "case folding" instead, which normalizes these differences for the > > purpose of case-insensitive comp

Re: case insensitive collation of Greek's sigma

2021-12-01 Thread Tom Lane
Peter Eisentraut writes: > Running lower() like this is really the wrong thing to do. We should be > doing "case folding" instead, which normalizes these differences for the > purpose of case-insensitive comparisons. That just begs the question: if tolower (or towlower) is

Re: case insensitive collation of Greek's sigma

2021-12-01 Thread Peter Eisentraut
ally does lower(a) LIKE lower(b), and select lower('ΣΣ' COLLATE "en_US"), lower('ΣΣ' COLLATE "en-US-x-icu"); lower | lower ---+--- σσ| σς Running lower() like this is really the wrong thing to do. We should be doing "case folding" instead, which normalizes these differences for the purpose of case-insensitive comparisons.

Re: case insensitive collation of Greek's sigma

2021-11-30 Thread Frank Limpert
Am 26.11.21 um 08:37 schrieb Jakub Jedelsky: Hello, during our tests of Postgres with ICU we found an issue with ILIKE of upper and lowercase sigma (Σ). The letter has two lowercase variants σ and ς (at the end of a word). I'm working with en_US and en-US-x-icu collations and results are a bi

Re: case insensitive collation of Greek's sigma

2021-11-26 Thread Tom Lane
Jakub Jedelsky writes: > during our tests of Postgres with ICU we found an issue with ILIKE of upper > and lowercase sigma (Σ). The letter has two lowercase variants σ and ς (at > the end of a word). I'm working with en_US and en-US-x-icu collations and > results are a bit unexpected - they are in

Re: case insensitive collation of Greek's sigma

2021-11-26 Thread Achilleas Mantzios
On 26/11/21 9:37 π.μ., Jakub Jedelsky wrote: Hello, Thank you for dealing with Greek! during our tests of Postgres with ICU we found an issue with ILIKE of upper and lowercase sigma (Σ). The letter has two lowercase variants σ and ς (at the end of a word). I'm working with en_US and en-US-x-i

case insensitive collation of Greek's sigma

2021-11-25 Thread Jakub Jedelsky
Hello, during our tests of Postgres with ICU we found an issue with ILIKE of upper and lowercase sigma (Σ). The letter has two lowercase variants σ and ς (at the end of a word). I'm working with en_US and en-US-x-icu collations and results are a bit unexpected - they are inverted: postgres=# SELE

Re: Case insensitive query on existing data

2020-08-13 Thread Saurav Sarkar
Thanks a lot Michael . Concurrent index building solves my problem of building index without locking. Best Regards, Saurav On Thu, Aug 13, 2020 at 10:45 PM Michael Lewis wrote: > create index concurrently lower( jsonb->>'name' ), drop old_index > concurrently, ensure that where/on/group by cond

Re: Case insensitive query on existing data

2020-08-13 Thread Michael Lewis
create index concurrently lower( jsonb->>'name' ), drop old_index concurrently, ensure that where/on/group by conditions use lower( jsonb->>'name' ), then take lunch. What's your concern with this process? >

Case insensitive query on existing data

2020-08-13 Thread Saurav Sarkar
Hi All, We use PostgreSQL JSONB storage. One of the keys in the JSON will be always have a "name" key. We want to perform case insensitive query on the name key. Our application is already live so we have some data and have existing indexes on the name key. I understand that one o

Re: Case Insensitive Comparison with Postgres 12

2019-10-12 Thread Daniel Verite
ifference between citext and case-insensitive collations by ICU is that the latter recognizes canonically equivalent sequences of codepoints [1] as equal, while the former does not. For instance: =# CREATE COLLATION ci (locale='und@colStrength=secondary', provider='icu', d

Re: Case Insensitive Comparison with Postgres 12

2019-10-11 Thread Igal Sapir
On Fri, Oct 11, 2019 at 1:09 AM stan wrote: > On Thu, Oct 10, 2019 at 05:41:47AM -0700, Igal @ Lucee.org wrote: > > On 10/9/2019 12:34 AM, Laurenz Albe wrote: > > > Igal Sapir wrote: > > > > I am trying to test a simple case insensitive comparison. Most > li

Re: Case Insensitive Comparison with Postgres 12

2019-10-10 Thread Igal @ Lucee.org
Thomas, On 10/10/2019 6:22 AM, Thomas Kellerer wrote: Igal @ Lucee.org schrieb am 10.10.2019 um 14:41: Thank you all for replying. I tried to use the locale suggested by both Laurenz and Pavel, en-US-u-ks-level2, but I'm still getting false for a simple comparison of 'Abc' = 'abc'. I tried t

Re: Case Insensitive Comparison with Postgres 12

2019-10-10 Thread Thomas Kellerer
Igal @ Lucee.org schrieb am 10.10.2019 um 14:41: > Thank you all for replying. I tried to use the locale suggested by > both Laurenz and Pavel, en-US-u-ks-level2, but I'm still getting > false for a simple comparison of 'Abc' = 'abc'. I tried the locale > both as a 'string' and as an "identifier"

Re: Case Insensitive Comparison with Postgres 12

2019-10-10 Thread Igal @ Lucee.org
On 10/9/2019 12:34 AM, Laurenz Albe wrote: 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_insens

Re: Case Insensitive Comparison with Postgres 12

2019-10-09 Thread Pavel Křehula
avel Dne 09.10.2019 0:51:52, "Igal Sapir" napsal: 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

Re: Case Insensitive Comparison with Postgres 12

2019-10-09 Thread Laurenz Albe
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=i

Re: Case Insensitive Comparison with Postgres 12

2019-10-09 Thread Wim Bertels
Using the datatype citext might be an alternative solution Igal Sapir schreef op October 8, 2019 10:51:52 PM UTC: >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 >

Re: Case Insensitive Comparison with Postgres 12

2019-10-08 Thread Morris de Oryx
As I understand it, custom collation are not applied globally. Meaning, you have to associate a collation with a column or en expression with COLLATE.

Case Insensitive Comparison with Postgres 12

2019-10-08 Thread Igal Sapir
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', dete

Re: Case Insensitive

2019-03-28 Thread Shreeyansh Dba
0 PM Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi PG-General and Pgsql-Admin > > Can we achieve CASE INSENSITIVE in PostgreSQL? > > I mean, need below way > > postgres=# select * from emp; > eid | ename > -+--- >1 | aaa >2 | AAA &

Re: Case Insensitive

2019-03-28 Thread Brad Nicholson
Andreas Kretschmer wrote on 03/28/2019 07:28:53 AM: > > > > Ummm... Will it use an index (a BTree index)? > > > > test=# explain select * from emp where ename = 'aaa'; > QUERY PLAN > - >  Seq Scan on emp  (cost=0.00..25.

Re: Case Insensitive

2019-03-28 Thread Tim Clarke
On 28/03/2019 11:10, Andy Anderson wrote: Would this also select characters with diacritical marks? For example, eid | ename -+--- 1 | aaa 2 | AAA 3 | áäâ 4 | āåȧ — Andy For that you need https://www.postgresql.org/docs/10/unaccent.html Tim Clarke Main: +44 (0)1376 503

Re: Case Insensitive

2019-03-28 Thread Andreas Kretschmer
Am 28.03.19 um 09:33 schrieb Sameer Kumar: test=*# select * from emp where ename = 'aaa';   eid | ename -+---     1 | aaa     2 | AAA (2 rows) Ummm... Will it use an index (a BTree index)? test=# explain select * from emp where ename = 'aaa';

Re: Case Insensitive

2019-03-28 Thread Andy Anderson
rote: > > > On Thu, 28 Mar, 2019, 4:20 PM Sridhar N Bamandlapally, <mailto:sridhar....@gmail.com>> wrote: > Hi PG-General and Pgsql-Admin > > Can we achieve CASE INSENSITIVE in PostgreSQL? > > You are perhaps migrating from another RDBMS where this kind of feature is

Re: Case Insensitive

2019-03-28 Thread Steve Atkins
upper function: >>>> >>>> select * from emp where upper(ename)=upper('aaa'); >>> That's a guaranteed table scan. >> Unless you have an index on upper(ename). > > Are you sure? I thought the lpart had to be immutable for the query > opt

Re: Case Insensitive

2019-03-28 Thread Peter Eisentraut
On 2019-03-28 09:20, Sridhar N Bamandlapally wrote: > Can we achieve CASE INSENSITIVE in PostgreSQL? Use the citext extension. In PostgreSQL 12, there will be support for case-insensitive collations. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 2

Re: Case Insensitive

2019-03-28 Thread Ron
On 3/28/19 3:33 AM, Steve Atkins wrote: On Mar 28, 2019, at 8:29 AM, Ron wrote: On 3/28/19 3:23 AM, Sameer Kumar wrote: [snip] You can write a query with upper function: select * from emp where upper(ename)=upper('aaa'); That's a guaranteed table scan. Unless you have an index on upper(en

Re: Case Insensitive

2019-03-28 Thread Sridhar N Bamandlapally
With ILIKE or extension CITEXT, does it have any impact on Indexes, like not picking index ? ILIKE works only for operator LIKE not for operator = CITEXT seems some possibilities, Thanks Sridhar On Thu, Mar 28, 2019 at 2:07 PM Sameer Kumar wrote: > > > On Thu, 28 Mar, 2019, 4:33 PM Steve Atk

Re: Case Insensitive

2019-03-28 Thread Sameer Kumar
On Thu, 28 Mar, 2019, 4:33 PM Steve Atkins, wrote: > > > > On Mar 28, 2019, at 8:29 AM, Ron wrote: > > > > On 3/28/19 3:23 AM, Sameer Kumar wrote: > > [snip] > >> You can write a query with upper function: > >> > >> select * from emp where upper(ename)=upper('aaa'); > > > > That's a guaranteed t

Re: Case Insensitive

2019-03-28 Thread Steve Atkins
> On Mar 28, 2019, at 8:29 AM, Ron wrote: > > On 3/28/19 3:23 AM, Sameer Kumar wrote: > [snip] >> You can write a query with upper function: >> >> select * from emp where upper(ename)=upper('aaa'); > > That's a guaranteed table scan. Unless you have an index on upper(ename). Cheers, Stev

Re: Case Insensitive

2019-03-28 Thread Sameer Kumar
On Thu, 28 Mar, 2019, 4:28 PM Andreas Kretschmer, wrote: > > > Am 28.03.19 um 09:20 schrieb Sridhar N Bamandlapally: > > Hi PG-General and Pgsql-Admin > > > > Can we achieve CASE INSENSITIVE in PostgreSQL? > > test=# create extension citext; > CREATE EXTENSION

Re: Case Insensitive

2019-03-28 Thread Ron
On 3/28/19 3:23 AM, Sameer Kumar wrote: [snip] You can write a query with upper function: select * from emp where upper(ename)=upper('aaa'); That's a guaranteed table scan. -- Angular momentum makes the world go 'round.

Re: Case Insensitive

2019-03-28 Thread Andreas Kretschmer
Am 28.03.19 um 09:20 schrieb Sridhar N Bamandlapally: Hi PG-General and Pgsql-Admin Can we achieve CASE INSENSITIVE in PostgreSQL? test=# create extension citext; CREATE EXTENSION test=*# create table emp (eid int, ename citext); CREATE TABLE test=*# insert into emp values (1, 

Re: Case Insensitive

2019-03-28 Thread Murtuza Zabuawala
On Thu, Mar 28, 2019 at 1:50 PM Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi PG-General and Pgsql-Admin > > Can we achieve CASE INSENSITIVE in PostgreSQL? > You can try *select * from emp where ename *ILIKE *'aaa';* > > I mean, need below wa

Re: Case Insensitive

2019-03-28 Thread Ben Madin
dhar@gmail.com> wrote: > >> Hi PG-General and Pgsql-Admin >> >> Can we achieve CASE INSENSITIVE in PostgreSQL? >> > > You are perhaps migrating from another RDBMS where this kind of feature is > considered a feature. > > > >> I mean, need below w

Re: Case Insensitive

2019-03-28 Thread Sameer Kumar
On Thu, 28 Mar, 2019, 4:20 PM Sridhar N Bamandlapally, < sridhar@gmail.com> wrote: > Hi PG-General and Pgsql-Admin > > Can we achieve CASE INSENSITIVE in PostgreSQL? > You are perhaps migrating from another RDBMS where this kind of feature is considered a feature. > I

Case Insensitive

2019-03-28 Thread Sridhar N Bamandlapally
Hi PG-General and Pgsql-Admin Can we achieve CASE INSENSITIVE in PostgreSQL? I mean, need below way postgres=# select * from emp; eid | ename -+--- 1 | aaa 2 | AAA (2 rows) *postgres=# select * from emp where ename='aaa';* * eid | ename* *-+---* * 1 |