0

I'm using pg_admin on to select a specific user by email address. The selection looks like this

SELECT id, public_id
FROM public.users
where email = 'user1@test-inger.com';

I know that the user exists with ID 102 with the exact string for the email. But the select returns nothing. Our investigation showns that all cases for the problem contain a '-' in the email. Maybe this input is relevant.

Now if I'm using pg_admin to update the email address from 'user1@testinger.com' to 'anything@toaster.com', commit the change and revert to the initial value 'user1@testinger.com' the select find the result. It almost appears to me that the table row is corrupt.

The project runs with docker and I'm using postgres:13.5-alpine3.15. I have now tried to bring the backup to my development env and the select works. Any ideas how this can be fixed would be apprechiated.

abex.co
  • 41
  • 1
  • 1
  • 8
  • If the update works, I doubt that it's data corruption. It seems more likely that the original address contained a space or some other invisible or unprintable character. – Laurenz Albe May 10 '22 at 12:10
  • Unfortunately once resolved, the problem comes back after a while. This behavior tells me that it has nothing to do with invisible characters. – abex.co May 10 '22 at 13:18
  • If thee is an index on `email`, `REINDEX` that index. – Laurenz Albe May 10 '22 at 14:02

1 Answers1

0

We had the same error. Docker postgres:13.5-alpine3.14 Update to a newer version fixed the problem for long.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Ben the Coder May 10 '23 at 14:07