Re: Case Insensitive

Поиск
Список
Период
Сортировка
От Andy Anderson
Тема Re: Case Insensitive
Дата
Msg-id 7EF19AD1-94E8-4F8A-88E8-2F21B564AE2C@amherst.edu
обсуждение исходный текст
Ответ на Re: Case Insensitive  (Ben Madin <ben@ausvet.com.au>)
Ответы Re: Case Insensitive  (Tim Clarke <tim.clarke@minerva.info>)
Список pgsql-general
Would this also select characters with diacritical marks? For example,

eid | ename
-----+-------
   1 | aaa
   2 | AAA
   3 | áäâ
   4 | āåȧ

— Andy

On Mar 28, 2019, at 4:26 AM, Ben Madin <ben@ausvet.com.au> wrote:

Or you can just use `ilike`:

SELECT * FROM emp WHERE ename ilike 'aaa';


cheers

Ben

On Thu, 28 Mar 2019 at 16:24, Sameer Kumar <sameer.kumar@ashnik.com> wrote:


On Thu, 28 Mar, 2019, 4:20 PM Sridhar N Bamandlapally, <sridhar.bn1@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 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


You can write a query with upper function:

select * from emp where upper(ename)=upper('aaa');

Or you can overload the "=" operator for text arguements.



Thanks
Sridhar



--

Ausvet Logo

Dr Ben Madin
 
BVMS MVPHMgmt PhD MANZCVS GAICD
Managing Director
Skype: benmadin
Address: 
5 Shuffrey Street
Fremantle, WA 6160
Australia

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Prakash Ramakrishnan
Дата:
Сообщение: Re: plctl extension issue postgresql 11.2
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Case Insensitive