-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
I have found these related issues/pull requests
Description
When querying a citext column, the query will fail to find anything without explicitly casting the parameter to citext. If the types are incompatible, then I would expect the query to not compile. However, text is compatible with citext, so it is surprising that the query silently fails.
Reproduction steps
Given a table:
create table foos (name citext);
insert into foos(name) values ('foo'), ('bar');this query fails, and by fails i mean does not return a row when it should:
sqlx::query!("select count(*) from foos where name = $1", "Foo")this query succeeds:
sqlx::query!("select count(*) from foos where name = $1::citext", "Foo")If I copy and paste the query into other libraries (like psycopg for python) or into psql itself, it works as expected.
SQLx version
0.8.3
Enabled SQLx features
"runtime-tokio-rustls", "macros", "postgres", "json", "chrono", "uuid"
Database server and version
Postgres 15
Operating system
Ubuntu 22
Rust version
1.90.0
rlcintra and BeauGieskens