This statement works fine when I hardcode the "1" in the path and "nurse" as the new value:
person := JSONB_SET(person, '{1, title}', '"nurse"');
However, I would like to be able to use the same statements with variables as:
xindex := '1';
xtitle := '"nurse"';
person := JSONB_SET(person, '{xindex, title}', xtitle);
Any Ideas? Thank you