Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBTKI-0002lk-2h for pgsql-docs@arkaria.postgresql.org; Wed, 25 Apr 2018 22:55:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBTKH-00008H-0z for pgsql-docs@arkaria.postgresql.org; Wed, 25 Apr 2018 22:55:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBTKG-000088-O3 for pgsql-docs@lists.postgresql.org; Wed, 25 Apr 2018 22:55:48 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBTKE-0008DU-6w for pgsql-docs@lists.postgresql.org; Wed, 25 Apr 2018 22:55:47 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fBTKC-0005DX-N7; Wed, 25 Apr 2018 18:55:44 -0400 Date: Wed, 25 Apr 2018 18:55:44 -0400 From: Bruce Momjian To: roy@oneaudience.com, pgsql-docs@lists.postgresql.org Subject: Re: how does jsonb_set work? Message-ID: <20180425225544.GA24468@momjian.us> References: <152379992223.31235.17882617912768220310@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152379992223.31235.17882617912768220310@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Apr 15, 2018 at 01:45:22PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/10/static/functions-json.html > Description: > > the documentation is missing some information > > how does the jsonb_set function work? > does it create a whole new json and updates it in the column? or it actually > only updates the specific key in "path" jsonb_set() is a function that returns a JSONB value with the fields changed. It is up to you to assign it to a column. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +