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! :)
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