2015-10-22 43 views
0

我有更新json類型列元素值的問題;Json類型列元素更新 - Postgres

UPDATE employer SET address->>'locality' = 'NYC' where "Id"='30' 

地址jsonb類型列,並具有下列元素

{"region": "", "locality": "", "postal-code": "", "country-name": "CAN", "street-address": ""} 

因此,如何能在我這個地址欄更新本地元素?

注意;即時通訊使用的Postgres 9.4

謝謝

+1

http://stackoverflow.com/questions/26703476/how-to-perform-update-operations-on-columns-of-type-jsonb-in-postgres-9-4 – Andreas

回答

0

沒有選項我更新jsonB元素。我需要更新整個jsonb對象。

感謝