Azure / Azure/data-api-builder

[Bug]: Date filters are not supported for `date` in Postgres

Aperta
#3,094 1 commento 0 reazioni 1 assegnatario Rivendicata da @ArjunNarendra Vedi su GitHub
bug cri triage
Lingua principale
C#
Stelle
1.5k
Fork
370
Merge medio
3g 22h
PR unite (30g)
9

Descrizione

### 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

Image

### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.