I have a table services which has a column named properties whose type is text.
There are json data stored in properties column.
I can query json data with psql like this:
SELECT * FROM services WHERE properties::json->>'url' = 'www.example.com';
But I cannot update the json data with the following query:
UPDATE
services SET properties::json->>'url' = 'www.mydomain.com'
WHERE
properties::json->>'url' = 'www.example.com';
The UPDATE command above generates the error:
ERROR: syntax error at or near "::"
LINE 1: UPDATE services SET properties::json->>'url' = 'www.....
How can I update the url field inside the properties column?
What's wrong with my UPDATE command?