PostgreSQL - JSON and JSONB
Consider the query SELECT * FROM users WHERE data ? status; intended to check if the key 'status' exists in the JSONB column data. Why does this query fail?
Consider the query SELECT * FROM users WHERE data ? status; intended to check if the key 'status' exists in the JSONB column data. Why does this query fail?
? requires the key to be a string literal.status is not quoted, so PostgreSQL treats it as a column or identifier, causing failure.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions