Re: Strangeness with UNIQUE indexes and UTF-8

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Strangeness with UNIQUE indexes and UTF-8
Дата
Msg-id 224f667e31c565c9c73f7479a8fe9e8028dc0fb7.camel@cybertec.at
обсуждение исходный текст
Ответ на Strangeness with UNIQUE indexes and UTF-8  (Omar Kilani <omar.kilani@gmail.com>)
Список pgsql-hackers
On Sun, 2021-06-06 at 03:54 -0700, Omar Kilani wrote:
> There seems to be a weird bug in Postgres (last tested 11.12) where it
> allows an INSERT into a table with a UNIQUE / UNIQUE CONSTRAINT index
> on a TEXT/VARCHAR when there's already a value present in that index,
> but only for UTF-8 input.
> 
> I just had this happen on our user table and it somehow made it so
> that Postgres returned no results for *any* SELECT ... FROM x WHERE
> unique_col = 'x', which unfortunately meant no one could login to our
> service.
> 
> I had to:
> 
> SET enable_indexscan = off;
> SET enable_bitmapscan = off;
> 
> And then the data was returned properly.

Sounds like data corruption.
REINDEX the index and see if that fixes the problem.
Try to figure out the cause (bad hardware?).

Yours,
Laurenz Albe




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

Предыдущее
От: Omar Kilani
Дата:
Сообщение: Strangeness with UNIQUE indexes and UTF-8
Следующее
От: David Rowley
Дата:
Сообщение: Re: Strangeness with UNIQUE indexes and UTF-8