Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xEjF9-00000001FU8-14Hv for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Oct 2026 08:12:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xEjF8-0000000AZof-0kTO for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Oct 2026 08:12:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from <9erthalion6@gmail.com>) id 1xEjC0-0000000ATfq-40YW for pgsql-bugs@lists.postgresql.org; Thu, 08 Oct 2026 08:09:32 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from <9erthalion6@gmail.com>) id 1xEjBz-00000000x9t-1nhd for pgsql-bugs@lists.postgresql.org; Thu, 08 Oct 2026 08:09:32 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-48b03f23305so4168952f8f.1 for ; Thu, 08 Oct 2026 01:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791446970; x=1792051770; darn=lists.postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wr0/Ha8Bmdw1YPan3O2Uqveznqpzi9jUpQOcVxcEn+c=; b=OfMbKV2aT28ZJ6rv6VvqucIhq9+V+eFSS+fpFgDoY//JxfyCTxwdbLCVEqrOwzXbAj ihmBFvf9gxWG1dMLZST18Q9zRWb7cLLMN3fPhKr8n3Rk15DPhqzFFxbj+6vEWvy51jPp mm3VnErOVQDfQnlhJ5JrWysO9g1hLDaQXTSadM8llPilxIEiuaVdQ7FyFbCishVguLK/ boKCZ+4sAmo8C/SC5grugP6MflPTRcyk5T99Hx2BVWsNt5lFTk6VHl4+iaBiMBcHSiXz /jLAa3FATPVNf6OurxfDZ+ciwLCudJfMwLTOjNhDlohX4mvpi699zqsbSRrxvKye86T0 pTOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791446970; x=1792051770; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wr0/Ha8Bmdw1YPan3O2Uqveznqpzi9jUpQOcVxcEn+c=; b=HzNP0QFePih4MMtjRoaKbzQSIssIBxP8Vpi7hpiCK4sVrBOKia26Oe63irmedLPgnu fQ/z3rGeGWLUZgCPywSn3lBFGEh2SxcABfapRLeSmOUlzxvrK4CxNQx4iSrVIopw+hV5 mw4p+hRpQlgXXiGGwEIBxPJcrI/cC8gbx5yLOa1AFUAvYrjy60JxoyMZmrfQ9cB8aH3s cUpI6+sb9tJ1zY7cSfgghtlC0+29xYzzVjW4mwnAtCBa8OYNMouFVinmylH7bKlJdZdj MU5PsICOinAyQ7wjOH1Vs93ZjXIoZahliFaPSSCAzPu6X9Zdi/zxTWx+1RlAhJ5tkiRE 1MxQ== X-Forwarded-Encrypted: i=1; AKwUvBzCcT5r5SKq/+dlG6iYm0OGhdUL5T/fVB0bhKozmm1y5x4yWPUF4iFAJAvjNHK9AN7e/VnRA+LbFNKk@lists.postgresql.org X-Gm-Message-State: AFq9FYIFZb4VTe0mtKA4DdjRlMMMWYQJU9kbl4J8Eea8VpD7+B5pj+Zz g7s9Q6ThmQEi0JVP3ga4iRySiTrG4oqlxMiuDxUl/2ldvFS8inNFXfiC X-Gm-Gg: AYBFou287WZil35cQOZHQN+Ogr9o1ql1qMg1F3TnptGUgHpjfu5HKRDtlWokcWqagol gIeJmziVXBdJoqjlYjpmTfjWClFcFaF8a32Fg/MznSr8UDd6CNjGh/Gj99my5xWqmm00XyCwFbw m4kBYMfJV8qOKg9EgsmHQyuu3QsSqeFgWOU+DSwUIR/1hrzYGw2Urw+Exu+qMhex8DQWiRErqyh b2iC7VaHc0CBeS9A2teQQzKUq7O/GyLu+5aiMebBNa585YT9oJP6874mnqtGF8/Uls6TE12SwJN tYXYqXtctNNXPGQdn7tLxgaNgp4nH4umqskZBFIOr1YcbiZdzOwAfFekr7l4TWOG2yODaXbxAmK QJ9V2SZKBA8f3c3rgrNyu4pyOunXnvnGKwTho1ULh1OuHCouis7k/vIPU5D8ibaAoPc1Mqj+Lri 66YNl8DMAjW9bV9oJRK9zPJfatNfipfvht64mi/mg0YvjaInMt3trZch4MN+f/OYgeVzWqMU3uy Km+EVldsn2GrrI0/wI2Z+tc9Wdz4E1tm5hLHQ+1PW1wT9r/d/9AZHfeaTs/Ouke+O3fnbjOjm7V OjfgJYzy3+I= X-Received: by 2002:adf:f04e:0:b0:487:b4a:3f54 with SMTP id ffacd0b85a97d-48c7277d002mr6578962f8f.29.1791446969813; Thu, 08 Oct 2026 01:09:29 -0700 (PDT) Received: from ddolgov-thinkpadt14sgen1.rmtde.csb (dslb-092-077-223-190.092.077.pools.vodafone-ip.de. [92.77.223.190]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48c71d1ffbcsm9425598f8f.36.2026.10.08.01.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 01:09:29 -0700 (PDT) Date: Thu, 8 Oct 2026 10:09:26 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: shihao zhong Cc: =?utf-8?Q?=C3=81lvaro?= Herrera , Andrew Dunstan , pgsql-bugs@lists.postgresql.org, theshallow27@gmail.com Subject: Re: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL Message-ID: References: <19735-488819822dc79bca@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Wed, Oct 07, 2026 at 10:30:48PM -0400, shihao zhong wrote: > Hi Dmitry, > > I agree the docs should say which nulls are meant. > > I am not sure it was intended though. The jsonb array functions keep > a JSON null This is the one difference from most of the other functions, jsonb_agg_transfn_worker for some reason does not set skip_nulls, even though it has absent_on_null available. jsonb_object_agg_transfn_worker does it like: result->parseState->skip_nulls = absent_on_null; I presume jsonb_agg_transfn_worker have to be unified with the others. > , and JSON_OBJECT() drops the key only with RETURNING jsonb: From what I see it drops nulls due to ABSENT ON NULL, e.g. ABSENT ON NULL WITHOUT UNIQUE KEYS will do the same. Otherwise ditto, jsonb_build_object_worker sets skip_nulls like above if ABSENT ON NULL is specified. > Skipping only SQL NULLs needs no check per element in jsonb, the > caller knows which values it skipped. I mean to check per every element in the to be aggregated set.