I want to use jsonb_set function but I got this error:
function jsonb_set(jsonb, jsonb, boolean) does not exist
Info: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 28
here is my query:
UPDATE holidays SET logs = jsonb_set('[{"a":"foo"}]'::jsonb, '{}'::jsonb, true) WHERE id = 1;
€:
Replaced function with jsonb_insert (thats what I need) but still got error also with path:
malformed array literal: "[{"a":"foo"}]"
Detail: "[" must introduce explicitly-specified array dimensions.
Position: 41
code:
UPDATE holidays SET logs = jsonb_insert('[{"a":"foo"}]'::jsonb[], '{"b": "hello"}'::jsonb, '0', true) WHERE id = 1;
€: Solved it with logs = logs || '{"a": "foo"}'::jsonb