From: support-tiger <support@tigernassau.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: update field in jsonb
Date: Thu, 23 Nov 2017 17:46:47 -0700
Message-ID: <e5b4cafd-8b03-87d0-b8f8-ba7b84f663d4@tigernassau.com> (raw)
In-Reply-To: <CAF4Au4x4F8UdchvJAdG9KAHHdgCXQyS46iZe4ir-p9-CcRQoZA@mail.gmail.com>
References: <9a1c3dd0-39f0-7da2-61b6-58621a89a288@tigernassau.com>
<CAF4Au4x4F8UdchvJAdG9KAHHdgCXQyS46iZe4ir-p9-CcRQoZA@mail.gmail.com>
Oleg,
hey, thanks so much - if you are in USA visiting Yellowstone Natl Park
contact me and the beer is on me (maybe a Wyoming steak too!)
On 11/22/2017 11:27 PM, Oleg Bartunov wrote:
> On Thu, Nov 23, 2017 at 4:45 AM, support-tiger <support@tigernassau.com> wrote:
>> is there a way to update a single field in jsonb without replacing the
>> entire json document - couldn't find an example
>>
>> for example
>>
>> create table test (id primary key, data jsonb);
>>
>> insert into test ({"name":"bill", "age":29});
>>
>> ?? update test set data->age = 30
>
> update test set data = jsonb_set(data, '{age}', '30'::jsonb);
>
>>
>> --
>> Support Dept
>> Tiger Nassau, Inc.
>> www.tigernassau.com
>> 406-624-9310
>>
>>
>>
>
--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: support@tigernassau.com
Subject: Re: update field in jsonb
In-Reply-To: <e5b4cafd-8b03-87d0-b8f8-ba7b84f663d4@tigernassau.com>
References: <9a1c3dd0-39f0-7da2-61b6-58621a89a288@tigernassau.com> <CAF4Au4x4F8UdchvJAdG9KAHHdgCXQyS46iZe4ir-p9-CcRQoZA@mail.gmail.com> <e5b4cafd-8b03-87d0-b8f8-ba7b84f663d4@tigernassau.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox