Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo32H-0004Py-0b for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jun 2021 11:58:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo32F-0003XF-Vm for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jun 2021 11:58:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo32F-0003X7-P9 for pgsql-bugs@lists.postgresql.org; Tue, 01 Jun 2021 11:58:15 +0000 Received: from forward500p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:110]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo32C-0005iZ-1k for pgsql-bugs@lists.postgresql.org; Tue, 01 Jun 2021 11:58:14 +0000 Received: from sas2-548eec917f61.qloud-c.yandex.net (sas2-548eec917f61.qloud-c.yandex.net [IPv6:2a02:6b8:c08:b889:0:640:548e:ec91]) by forward500p.mail.yandex.net (Yandex) with ESMTP id 7B8E0940669; Tue, 1 Jun 2021 14:58:06 +0300 (MSK) Received: from mail.yandex.ru (mail.yandex.ru [217.66.159.58]) by sas2-548eec917f61.qloud-c.yandex.net (mxback/Yandex) with HTTP id 4wfVwc1KVSw1-w5KaqUfu; Tue, 01 Jun 2021 14:58:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zsrv.org; s=mail; t=1622548685; bh=ir1JHbvSP+2znsz9iIeScRIzq/V+ewLvItqfW7v9a4g=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=JBN1jA4EeoUfE9cEF/wmE9qodcNz+VJnW2HIcGcXCrBY6aWHM79q05baCP7tWyhpO hddV6Ic1+S2LsxB8p0Am6QVpyx6I07nFp3jBPmYHRkdETi7avPsZZQkyWneR7q8fgu Q58RtUrJuRyBxJ7bcm7fuy6Bkc9gLd87fplQ1xrs= Authentication-Results: sas2-548eec917f61.qloud-c.yandex.net; dkim=pass header.i=@zsrv.org Received: by sas1-c37eebe3eab8.qloud-c.yandex.net with HTTP; Tue, 01 Jun 2021 14:58:04 +0300 From: Sergei Kornilov To: Eugene Pazhitnov , "pgsql-bugs@lists.postgresql.org" In-Reply-To: References: Subject: Re: jsonb merge with update ... on conflict do MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 01 Jun 2021 14:58:04 +0300 Message-Id: <469851622548513@mail.yandex.ru> Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello You meant ... do update set price=test.price || '{"CA":20}'::jsonb; ? Or possibly ... do update set price=test.price || EXCLUDED.price; ? In other words, why did you expect the result {"CA":20,"RU":10} ? regards, Sergei