update field in jsonb

From: support-tiger <support(at)tigernassau(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: update field in jsonb
Date: 2017-11-23 01:45:44
Message-ID: 9a1c3dd0-39f0-7da2-61b6-58621a89a288@tigernassau.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivan E. Panchenko 2017-11-23 06:06:02 Re: update field in jsonb
Previous Message Tom Lane 2017-11-23 01:44:58 Re: backends stuck in "startup"