A
A
Anton2014-10-30 12:31:41
PostgreSQL
Anton, 2014-10-30 12:31:41

How to make PostgreSQL not distinguish between the letters "E" and "Yo"?

It is necessary that the type query returns (including) records where Well, and vice versa. I remember that in MySQL this was possible.
select * from tbl where surname = 'фёдоров';
surname = 'федоров'.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Raccoon, 2020-08-03
@antonov22

Solved such a problem. Came to what to do through the regular season.
If the query string contains the letter "e", then all occurrences are replaced by [e|e]
$q = str_replace('e', '[e|e]', $q);
and in sql already comes with

select *
from tbl
WHERE tbl.name SIMILAR TO '%ж[е|ё]лтый%'

A
Anton, 2014-10-30
@zeromodule

The solution could be this:

select * from tbl where replace(surname, 'ё', 'е') = '{$surname}';

I
Ilya Chubarov, 2020-10-22
@agoalofalife

It is probably still possible to exclude this notorious letter e in the database . In Mysql, this query will replace all letters, if it fits, then it will be possible to avoid problems in the future. They change something in the code, dig a hole for themselves.
UPDATE table SET field = REPLACE(field, 'ё', 'е');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question