Re: Some questions on PostgreSQL 9.6 JSONB

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Keith <keith(at)keithf4(dot)com>
Cc: Wei Shan <weishan(dot)ang(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Some questions on PostgreSQL 9.6 JSONB
Date: 2017-08-28 15:20:15
Message-ID: CAKFQuwaBRkMYUH-frGJ+koH6=AoVWyTrOSxDugeE4-7jsZv4TA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 28, 2017 at 7:06 AM, Keith <keith(at)keithf4(dot)com> wrote:

> On Mon, Aug 28, 2017 at 9:46 AM, Wei Shan <weishan(dot)ang(at)gmail(dot)com> 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(at)keith=# UPDATE json_data SET data = jsonb_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.​

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Don Seiler 2017-08-28 15:43:07 Why is my table not autovacuuming?
Previous Message Keith 2017-08-28 14:06:44 Re: Some questions on PostgreSQL 9.6 JSONB