From: Shreeyansh Dba <shreeyansh2014@gmail.com>
To: Sridhar N Bamandlapally <sridhar.bn1@gmail.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Case Insensitive
Date: Thu, 28 Mar 2019 21:07:33 +0530
Message-ID: <CAGDYbUNQOOwnYDFGCzWvbZ1qqrnTe9QMBO+AtEdGmcNKZy4cRg@mail.gmail.com> (raw)
In-Reply-To: <CAGuFTBU1fACZWYdVwU-HiBJWAt2QFRa9fkB+SovmVMoUjVbekw@mail.gmail.com>
References: <CAGuFTBU1fACZWYdVwU-HiBJWAt2QFRa9fkB+SovmVMoUjVbekw@mail.gmail.com>
Hi Sridhar,
There are a few workarounds available, hope this will help you.
1) Use the citext extension
2) Use ILIKE instead of LIKE
3) Use Postgres lower() function
4) Add an index on lower(ename)
Thanks & Regards,
*Shreeyansh DBA Team*
www.shreeyansh.com
On Thu, Mar 28, 2019 at 1:50 PM Sridhar N Bamandlapally <
sridhar.bn1@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
> (2 rows)
>
>
>
> *postgres=# select * from emp where ename='aaa';*
> * eid | ename*
> *-----+-------*
> * 1 | aaa*
> * 2 | AAA*
> *(2 rows)*
> *--above result is just an manual made example only*
>
>
> Thanks
> Sridhar
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: shreeyansh2014@gmail.com, sridhar.bn1@gmail.com, pgsql-general@postgresql.org
Subject: Re: Case Insensitive
In-Reply-To: <CAGDYbUNQOOwnYDFGCzWvbZ1qqrnTe9QMBO+AtEdGmcNKZy4cRg@mail.gmail.com>
References: <CAGuFTBU1fACZWYdVwU-HiBJWAt2QFRa9fkB+SovmVMoUjVbekw@mail.gmail.com> <CAGDYbUNQOOwnYDFGCzWvbZ1qqrnTe9QMBO+AtEdGmcNKZy4cRg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox