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 1xD75n-00000000K4s-08oO for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Oct 2026 21:16:27 +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 1xD75m-000000039U9-0L8f for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Oct 2026 21:16:26 +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 ) id 1xClMN-00000001Tcq-0I1k for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:04:07 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xClML-000000004eH-2FU9 for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:04:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=7FQruionNHPvpxnuoXuy9ZfU/Cr8vUkiYfe0e0+MJq4=; b=TSnGzUm4c1PTxp5Tqi7WXAFyp5 U3jCqnmNIa71AgWEVtNugPWSDSjud2E1ygvqMlVVDFwYPOvj+bHniXagSsqY+HWHxF85hI/wb80uy st0DI8phygFC/BQWTQKR0oXQTD1m05gXdwqdR3/abWJyRdZ9g2FbUWsvePh1c5K5f+yHrHZ1wRqfR 2Qq5e0eVoHN1BPk0Td/Y9NNZ8YHsiIWXLd+yaO11TQNZtc4vfM/z3f2/UuNIGmqF7bNm+fTLAa1+3 yF1Gd7rNuTefgtQqNT9n+y8zyIpCe0VABXIDxFIHmd0jZnxpQMRr9Di26mledbxCntCndgK2zsZJR D0CJWtpg==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xClML-00000000ITR-0z0E for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:04:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xClMJ-00000000qhm-3vbS for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:04:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: theshallow27@gmail.com Reply-To: theshallow27@gmail.com, pgsql-bugs@lists.postgresql.org Date: Fri, 02 Oct 2026 22:03:41 +0000 Message-ID: <19735-488819822dc79bca@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19735 Logged by: Shallow Email address: theshallow27@gmail.com PostgreSQL version: 18.6 Operating system: Linux Description: =20 The strict JSONB object aggregate omits a non-SQL-NULL `jsonb` datum whose JSON value is `null`. The corresponding non-strict JSONB aggregate and strict JSON aggregate preserve the key with a JSON null value. The aggregate documentation says that strict mode skips a value when the value is NULL; a JSONB `null` value is distinct from SQL NULL. **Reproduction:** ```sql SELECT jsonb_object_agg_unique_strict('a', 'null'::jsonb)::text, jsonb_object_agg_unique('a', 'null'::jsonb)::text, json_object_agg_unique_strict('a', 'null'::jsonb)::text; ``` **Actual result:** ```text {} | {"a": null} | { "a" : null } ``` **Expected result:** The strict JSONB aggregate should skip SQL NULL values but preserve a JSONB datum containing JSON `null`, consistent with the other two aggregate results.