0

i have the following column configuration which stores a large amount of information in a jsonb datatype. The column in my table looks like this:

select configuration -> 'object'-> 0 FROM my_table;
               ?column?
--------------------------------------------
[{"resources": {"r1": 1, "r2": 2, "r3": 3}]

I'm trying to update the value r3 with the jsonb_set function in this way:

update my_table 
set configuration = jsonb_set(configuration::jsonb, '{object,0,resources,r3}::text[]', jsonb '6')

The path looks correct, and the data type as well. Anyway, Im getting the following error:

ERROR:  function jsonb_set(jsonb, text[], jsonb) does not exist

Are the data types still not correct? How can I make it work? Thanks in advance! :)

2
  • 3
    jsonb_set() was introduced in 9.5, so you can't use it in 9.4 But as Postgres 9.4 is no longer supported this is a perfect moment to do your upgrade to 12 Commented Sep 2, 2020 at 13:19
  • ah I thought it as introduced in 9.4. Thanks! Commented Sep 2, 2020 at 13:21

1 Answer 1

1

Solved, as a_horse_with_no_name said is not possible to use that function in postgres 9.4!

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.