querying JSON field #738
Answered
by
kyleconroy
deelienardy
asked this question in
Q&A
|
i have table something like this on postgres while i know it is bad querying from JSON, but this is legacy data structure, so shit happen let say data on metadata is like this when i create query the generated parameters will become like this So, the question should it type on parameter become |
Answered by
kyleconroy
Oct 23, 2020
Replies: 2 comments 4 replies
|
The type of the address1 field on the JSON column isn't known at compile time. You're correct that the parameter type should be You probably know the type of address1, so you can always cast it to text: |
2 replies
Answer selected by
kyleconroy
|
why is it bad to query JSONB? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The type of the address1 field on the JSON column isn't known at compile time. You're correct that the parameter type should be
interface{}instead ofjson.RawMessage. I've created #743 to track that bug.You probably know the type of address1, so you can always cast it to text: