11 | | |
12 | | ERROR: operator does not exist: jsonb = character varying |
13 | | LINE 1: ...AND ("resource" #> '{foo,id}') IN (SELECT... |
14 | | |
15 | | The actual issue is that when passing a values_list() to __in, the values list is not cast to jsonb (unlike when passing a text type). In the resulting sql, we can see `IN (SELECT U0."id" AS Col1 FROM mymodel2 U0 ...)`. Wrapping `to_json(U0."id")` solves the issue. |
| 11 | {{{ |
| 12 | ERROR: operator does not exist: jsonb = character varying |
| 13 | LINE 1: ...AND ("resource" #> '{foo,id}') IN (SELECT... |
| 14 | }}} |
| 15 | The actual issue is that when passing a `values_list()` to `__in`, the values list is not cast to jsonb (unlike when passing a text type). In the resulting sql, we can see `IN (SELECT U0."id" AS Col1 FROM mymodel2 U0 ...)`. Wrapping `to_json(U0."id")` solves the issue. |