Changes between Version 1 and Version 2 of Ticket #28872


Ignore:
Timestamp:
Dec 27, 2017, 12:21:39 PM (7 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28872

    • Property Triage Stage UnreviewedAccepted
  • Ticket #28872 – Description

    v1 v2  
    99
    1010Actual result:
    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{{{
     12ERROR:  operator does not exist: jsonb = character varying
     13LINE 1: ...AND ("resource" #> '{foo,id}') IN (SELECT...
     14}}}
     15The 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.
Back to Top