On Mon, Aug 28, 2017 at 9:46 AM, Wei Shan <weishan.ang@xxxxxxxxx> wrote:Is this the most efficient way to do it? I'm not sure because this is basically replacing the entire JSON object instead of updating a single field.
keith@keith=# UPDATE json_data SET data = "" '{account_balance}', '1'::jsonb, false);
This. Note still that in a MVCC (multi-version concurrency controlling) database you never really just update something in place since the old something has to continue to exist at the same time as the new something - at least for a little while.
David J.