Skip to content
Advertisement

COALESCE types jsonb and boolean cannot be matched

I have next part of query:

and I am getting next error:

Advertisement

Answer

The error with the query comes here:

Both operands of coalesce() must have the same datatype. It looks like data is json, so it mismatches against boolean value true.

Probably, you want to cast the boolean to a json text:

This should also work:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement