Case insensitive query on existing data

From: Saurav Sarkar <saurav(dot)sarkar1(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Case insensitive query on existing data
Date: 2020-08-13 11:40:53
Message-ID: CAP+kwAUaeWHSvHVfqsJQ7cRMaBYZ36_khiwdiV3wZ3O1qabr7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 of the ways is to create index on the lower(name)
and use the lower function. And then to recreate the indexes on the name
key.

Is there any other way through which this can be achieved ? May be an
option to not to recreate indexes.

Thanks and Best Regards,
Saurav

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Naveen Kumar 2020-08-13 13:40:31 Bytea Example
Previous Message mohand oubelkacem makhoukhene 2020-08-13 10:25:45 Implement a new data type