Re: Case Insensitive

From: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
To: Sridhar N Bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Case Insensitive
Date: 2019-03-28 15:37:33
Message-ID: CAGDYbUNQOOwnYDFGCzWvbZ1qqrnTe9QMBO+AtEdGmcNKZy4cRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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(dot)bn1(at)gmail(dot)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
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Raj Gandhi 2019-03-28 22:41:13 LIMIT OFFSET with DB view vs plain SQL
Previous Message MichaelDBA 2019-03-28 13:23:55 Re: Long running query in new production, not so long in old

Browse pgsql-general by date

  From Date Subject
Next Message Prakash Ramakrishnan 2019-03-28 15:39:59 Re: plctl extension issue postgresql 11.2
Previous Message Tom Lane 2019-03-28 14:56:01 Re: plctl extension issue postgresql 11.2