Azure / Azure/data-api-builder
[Bug]: Date filters are not supported for `date` in Postgres
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
### What happened?
Say if the table has a column type as Date, and we're trying to execute a graphql query like below
```
query {
todos(filter: { dueDate: { gte: "2024-01-01T00:00:00.000Z" } }) {
items {
dueDate
}
}
}
```
Then we will hit below error "operator does not exist: date >= text":
```
{
"errors": [
{
"message": "42883: operator does not exist: date >= text\r\n\r\nPOSITION: 168",
"locations": [
{
"line": 2,
"column": 2
}
],
"path": [
"todos"
],
"extensions": {
"code": "DatabaseOperationFailed"
}
}
],
"data": null
}
```
It looks like eventually the SQL statements generated will convert the string literal "2024-01-01T00:00:00.000Z" into Text type in PGSQL, and such comparison is not supported.
I can reproduce the same by running below SQL query directly with PGSQL
### Version
0.2025.909.2
### What database are you using?
PostgreSQL
### What hosting model are you using?
Local (including CLI)
### Which API approach are you accessing DAB through?
GraphQL
### Relevant log output
```Text
2026-01-27 18:09:49.491 UTC [82] ERROR: operator does not exist: timestamp with time zone = text at character 213
2026-01-27 18:09:49.491 UTC [82] HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
2026-01-27 18:09:49.491 UTC [82] STATEMENT: SELECT COALESCE(jsonb_agg(to_jsonb("subq6")), '[]') AS "data" FROM ( SELECT "table0"."id" AS "id", "table0"."dueDate" AS "dueDate" FROM "public"."Todos" AS "table0" WHERE ($1 = "user_id") AND ("table0"."dueDate" = $2 OR "table0"."dueDate" = $3) ORDER BY "table0"."id" ASC LIMIT 100 ) AS "subq6"
2026-01-27 18:13:37.187 UTC [62] LOG: checkpoint starting: time
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.