Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP6Vd-0004jf-SG for pgsql-general@arkaria.postgresql.org; Mon, 28 Oct 2019 15:00:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iP6Vc-0003G0-LH for pgsql-general@arkaria.postgresql.org; Mon, 28 Oct 2019 15:00:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP6Vb-0003Fa-Oy; Mon, 28 Oct 2019 15:00:40 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iP6VY-00039D-C4; Mon, 28 Oct 2019 15:00:38 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AAAB221B42; Mon, 28 Oct 2019 11:00:34 -0400 (EDT) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Mon, 28 Oct 2019 11:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ZgSA2v j70Fpbda0uxIERX9hTOJblYwOSGB4MfWCqyCc=; b=CKWRYcbEfkop630ByDmWDN SToi07zUyz6ObX1FCzOdP1NkEJaIQhuNtN1ymJcD5n1AQk7uxiITcDd8mLIB5bAn 0AsVOWcGfCJomTrQNa6JUUd/ns+PhMmItiA0eD/THLfi30ub5Wn/vtnqoiTN3Gll qAT6fqReZftOPpPixYYXoSltJ8WK/GWIAz3n+k68PaARLP79uWe/umHWkMszkUQe ENspz71o0BCOcZU8/zt9YHG47yB/gyoeyEHOqsLZvQMKHyCo9ZXpkncCy+r/aUg+ nZxhS3/qqihFxJ305uU+6YxPWwIy21pHRbQty3RPJM8eQ3WZU6/HWljsFOKmnHhw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrleelgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfofgrrhhk ucfhvghluggvrhdfuceofhgvlhgusefhrhgvvgeuufffrdhorhhgqeenucfrrghrrghmpe hmrghilhhfrhhomhepfhgvlhgusefhrhgvvgeuufffrdhorhhgnecuvehluhhsthgvrhfu ihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4D2964C000A3; Mon, 28 Oct 2019 11:00:33 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-470-gedfae93-fmstable-20191021v4 Mime-Version: 1.0 Message-Id: <2a60e719-0c93-4d68-a94d-436fcd928d3d@www.fastmail.com> In-Reply-To: <375873e2-c957-3a8d-64f9-26c43c2b16e7@2ndQuadrant.com> References: <20191019192723.luarxhq57qkzuncw@development> <1571560798575.47024@Optiver.com> <34a7ff88-0d86-0990-4eac-48159df8d7f2@2ndQuadrant.com> <5db07acf-bc75-edf8-60af-905c0adadb68@2ndQuadrant.com> <20191020201839.olpuyuzixagcvvud@development> <5b8a26bf-6b46-71f3-a99e-3fb9a8095232@2ndQuadrant.com> <20191021060701.or6a6a7lg3asixom@development> <544ecc1e-681e-69f1-5cde-8b8aaeb45d7f@2ndQuadrant.com> <375873e2-c957-3a8d-64f9-26c43c2b16e7@2ndQuadrant.com> Date: Mon, 28 Oct 2019 10:00:12 -0500 From: "Mark Felder" To: "Andrew Dunstan" , "Tomas Vondra" Cc: "David G. Johnston" , "Floris Van Nee" , "Ariadne Conill" , "pgsql-generallists.postgresql.org" , "PostgreSQL Hackers" Subject: Re: jsonb_set() strictness considered harmful to data Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Oct 28, 2019, at 08:52, Andrew Dunstan wrote: > > For release 13+, I have given some more thought to what should be done. > I think the bar for altering the behaviour of a function should be > rather higher than we have in the present case, and the longer the > function has been sanctioned by time the higher the bar should be. > However, I think there is a case to be made for providing a non-strict > jsonb_set type function. To advance th4e discussion, attached is a POC > patch that does that. This can also be done as an extension, meaning > that users of back branches could deploy it immediately. I've tested > this against release 12, but I think it could go probably all the way > back to 9.5. The new function is named jsonb_ set_lax, but I'm open to > bikeshedding. > > Thank you Andrew, and I understand the difficulty in making changes to functions that already exist in production deployments. An additional function like this would be helpful to many. -- Mark Felder ports-secteam & portmgr alumni feld@FreeBSD.org