I have found these related issues/pull requests
None
Description
Selecting a VARBYTE column from Redshift causes sqlx to return SELECT DISTINCT ON is not supported, even though the query does not use DISTINCT ON.
Reproduction steps
- Create/use a Redshift table with a
VARBYTE column named payload.
- Run:
let pool = PgPoolOptions::new()
.max_connections(1)
.connect_with(
PgConnectOptions::from_str(
"postgresql://admin:XXXXXXXXX@iggy-wg.087767584429.us-east-1.redshift-serverless.amazonaws.com:5439/dev"
).unwrap()
.statement_cache_capacity(0)
)
.await.unwrap();
let query = sqlx::AssertSqlSafe(
"SELECT payload FROM \"iggy_messages\" ORDER BY iggy_offset"
);
let result = sqlx::query(query).fetch_all(&pool).await.unwrap();
- Observe:
Database(PgDatabaseError {
severity: Error,
code: "0A000",
message: "SELECT DISTINCT ON is not supported",
...
})
Removing payload from the SELECT makes the query work.
SQLx version
0.9.0
Enabled SQLx features
runtime-tokio, tls-rustls, postgres, chrono, uuid, json
Database server and version
Amazon Redshift Serverless
Operating system
Mac OS
Rust version
rustc 1.97.1 (8bab26f4f 2026-07-14)
I have found these related issues/pull requests
None
Description
Selecting a VARBYTE column from Redshift causes sqlx to return SELECT DISTINCT ON is not supported, even though the query does not use DISTINCT ON.
Reproduction steps
VARBYTEcolumn namedpayload.Removing
payloadfrom theSELECTmakes the query work.SQLx version
0.9.0
Enabled SQLx features
runtime-tokio, tls-rustls, postgres, chrono, uuid, json
Database server and version
Amazon Redshift Serverless
Operating system
Mac OS
Rust version
rustc 1.97.1 (8bab26f4f 2026-07-14)