'Is there any way to update json column?

ALTER TABLE
managers
UPDATE
JSONExtractString(managers.extra_data, 'name') = JSONExtractString(other_table.extra_data, 'name')
WHERE 1

Query above does not work, also couldn't find something similar to jsonb_set function like in psql



Solution 1:[1]

You can create dictionary with other_table as source and then use JSONExtractString(dictGet('my_dict', managers.key), 'name') to read data from dict for each specific key. In your case there is no way to understand how to join rows in this two tables.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ilya Yatsishin