I need to update my JSON object to see if it matches the condition. For eg: I need to replace "foo" to "loo":
I tried using
select (
case when (
json_extract_path_text( '{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4', 'f6') = "foo") then "loo"
else "oo" end)
It gives me an ERROR: column "foo" does not exist on ="foo".
How can I replace text in my JSON object using Postgres?