Hello I have column of type JSON where I store for example '{ "foo": 0 }' now I would like to write trigger which will be increment value on specific action. I have problem because I don't know how increment or set 0 value if updated value not exist. I tried to write function similar to code from here: https://stackoverflow.com/a/44563662/10999632 but It is not possible because:
ERROR: function jsonb_set(json, unknown, jsonb) does not exist
LINE 2: SET payload = jsonb_set(payload, '{bar}', (COALESCE(payload-...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.