Search Postgresql Archives

String comparison fails for some cases after migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

We moved our PostgreSQL database from one hosting provider to another using pgbackrest.  In the new environment, some comparison operations  were failing.  The issue was fixed by running an update. But I am trying to find out what would have happened.

select * from accounts where email = 'someemail@xxxxxxxxx'; -- failed for some email ids even though there were records.

select * from accounts where lower(trim(email)) <> email; -- fetched no records.

select * from accounts where email::bytea = 'someemail@xxxxxxxxx'::bytea; - worked for those records where comparison was failing.

update accounts set email = trim(lower(email)); -- fixed the issue.

Source database was PG 13.2, target 13.3.

Any suggestions will be appreciated - not sure if other tables/columns are affected.

Best Regards,
Jayadevan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux