Re: problem about reindex

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: liam saffioti <liam(dot)saffiotti(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: problem about reindex
Date: 2021-09-22 11:37:39
Message-ID: CAOBaU_YgN52=LjUBTxGpsYUSF-Pceoz6tWPycj9gbZTp_UR_-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

On Wed, Sep 22, 2021 at 7:19 PM liam saffioti <liam(dot)saffiotti(at)gmail(dot)com> wrote:
>
> I'm using PostgreSQL 12.7 on RHEL 8.4. I have a table that has 3132 rows. I faced an interesting case when I run this query.
>
> select * from enterprise.private_room where name = 'mannheis';
> id | name | user_id | create_time | sub_package_id | password | tenant_id
> ----+------+---------+-------------+----------------+----------+-----------
> (0 rows)
>
> But the table has this row:
>
> select * from enterprise.private_room where lower(name) = 'mannheis';
>
> id | name | user_id | create_time | sub_package_id | password | tenant_id
> -------+---------------------+--------------------------------------+----------------------------+----------------+----------+-----------
> 67182 | mannheis | f4e14cbe-f8e2-4c04-85cf-30271cc08526 | 2020-06-15 14:35:51 | 101361 | | 3
>
> I got the same result with this query : select * from enterprise.private_room where trim(name) = 'mannheis';
>
> After doing reindex the table, the problem was solved. But I don't understand why this problem occurs.

It means that your index was corrupted, and your REINDEX fixed it.
Given that it's an index on a collatable datatype, one reason for the
initial corruption would be an upgrade of your operating system
library providing the collation (glibc or icu, depending on your
index) without a subsequent REINDEX of all your indexes depending on a
collatable datatype. Have you upgraded your system's collation
library since the initial creation of this index?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message liam saffioti 2021-09-22 12:06:36 Re: problem about reindex
Previous Message liam saffioti 2021-09-22 11:19:24 problem about reindex