4

Have a JSONB column with data like this:

{"title": "Some book!", "uniqueId": "11264299-2543-566"}

When I try to select the values, they are returned with double quotes surrounding them...

SELECT 'Some book!', json_data->'title' FROM myJsonTable

Returns:

Some book!      "Some book!"
1
  • 8
    on phone: SELECT 'Some book!', json_data->>'title' FROM myJsonTable; notice the double arrow, single -> returns type JSON where strings are quoted. Commented Mar 19, 2015 at 2:29

1 Answer 1

7

Instead of using json_data->'title', I needed to use jsonb_extract_path_text(json_data, 'title')...

Edit: Or as Lucas said in the comment, use json_data->>'title'...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.