Azure / Azure/data-api-builder

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

Abierto
#3,094 1 comentario 0 reacciones 1 asignado Reclamado por @ArjunNarendra Ver en GitHub
bug cri triage
Lenguaje dominante
C#
Estrellas
1.5k
Forks
370
Merge medio
3 d 22 h
PR fusionados (30 d)
9

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.