Case insensitive query on existing data - Mailing list pgsql-general

From Saurav Sarkar
Subject Case insensitive query on existing data
Date
Msg-id CAP+kwAUaeWHSvHVfqsJQ7cRMaBYZ36_khiwdiV3wZ3O1qabr7Q@mail.gmail.com
Whole thread Raw
Responses Re: Case insensitive query on existing data
List 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

pgsql-general by date:

Previous
From: mohand oubelkacem makhoukhene
Date:
Subject: Implement a new data type
Next
From: Naveen Kumar
Date:
Subject: Bytea Example