Skip to content

In a where clause, the equals operator doesn't work well for basic queries. #704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DavidPerezIngeniero opened this issue Mar 31, 2020 · 6 comments

Comments

@DavidPerezIngeniero
Copy link

DavidPerezIngeniero commented Mar 31, 2020

11.7-alpine version exhibits this strange behaviour:

# select '[' || lis_lis || ']' from imalis where lis_lis like 'PME_USU_00'; 
   ?column?   
--------------
 [PME_USU_00]
(1 row)

whereas:

# select '[' || lis_lis || ']' from imalis where lis_lis = 'PME_USU_00'; 
 ?column? 
----------
(0 rows)

Non-Docker Postgres 11 shows consistent results with exactly the same data (rsync'ed), i.e., 1 row of results for both selects.

lis_lis is a varying char(20) column that is the primary key of the table.
Using:

  • amd64
  • Docker version 19.03.6-ce, build 369ce74
  • Host is Amazon Linux.
@DavidPerezIngeniero
Copy link
Author

DavidPerezIngeniero commented Mar 31, 2020

Tags 11.6-alpine and 11.5-alpine also have the same bug.

@wglambert
Copy link

Do you know if it does this in the non-Alpine variant too?

@DavidPerezIngeniero
Copy link
Author

I cannot test because the debian variant doesn't support the es-ES.UTF-8 locale.

@DavidPerezIngeniero
Copy link
Author

DavidPerezIngeniero commented Apr 1, 2020

Confirmed that Debian variant works ok.
So this is a bug in the Alpine specific variant.

@wglambert
Copy link

Yeah it doesn't seem like something we can change at our level, probably have to file it upstream somewhere

https://github.com/docker-library/docs/tree/master/postgres#postgresversion-alpine

The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements.

@yosifkit
Copy link
Member

yosifkit commented Apr 1, 2020

Seems related to #327

@tianon tianon closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants