Skip to content
Advertisement

JSONB column does not exist

I got this error.

ERROR: column “name” does not exist LINE 6:

from this query

How can I select JSON value?

Advertisement

Answer

You are missing quotes around the name of the JSON attribute that you want to select. Just likes object keys must always be quoted when the JSON object is declared, they need to be quoted when accessing it too.

See the Postgres documentation for the JSON datatype and JSON Functions and Operators.

You would need to change this:

To:

Demo on DB Fiddle.

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