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.94.2) (envelope-from ) id 1tZ5Un-000Z4b-U0 for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Jan 2025 09:52:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tZ5Um-00Gry2-6a for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Jan 2025 09:52:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tZ5Ul-00Grxu-Rg for pgsql-hackers@lists.postgresql.org; Sat, 18 Jan 2025 09:52:00 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tZ5Uj-000As4-09 for pgsql-hackers@lists.postgresql.org; Sat, 18 Jan 2025 09:51:59 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43626213fffso24169625e9.1 for ; Sat, 18 Jan 2025 01:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737193916; x=1737798716; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=496RsSMwqdsMDooJkaHk6w6BQalBu4aNYkNMd0GnHzk=; b=jbqmOeJhhrVoA6qQ7EQqOetLjJnF/adEFy3iG5lKtMOPp9MVFpyxMuxC0hNrbpVY0I sEdUjf8X6QhXyrqLKRMccGaKOhwFJSRL72w98niWmoSbgmXddB7ZoOv0MZOHyuFAyhok Tzx+SOUU3l1BWaIF3hL2iWjv1rQ12DIwK8ZEKJcuXJlUUIDn+Cljpi3pWV5gKB2S3zqj ne+IrKOc9Xf2yyTAg6srfVL6k1XzM2lGHgQSPieelIvD+Q5PC12i4//DrgrRUYUOAD3n kJSvlwu0IVFDV+P9KScGj4sQ0hPVCFHXBNZTn7e7YswNkLtLhwwhumTsdb6hDrMPqmj2 bHVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737193916; x=1737798716; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=496RsSMwqdsMDooJkaHk6w6BQalBu4aNYkNMd0GnHzk=; b=oaDFrdsjSWBCYAYz0r/V7FuNN2kv6MZamPyofgxHXCpXl9loPi+Ahh1FGbe70Ceyif E9ZbZGL7EucIXJwk+0XoJ5dOYpg1z4wjHwVv4EKkC3g7/K/AavSDTyu7q/yvbLe/3Be5 fX4Ne0rTl+lnp/8dDPybytiBwAWk83MsrevIvUSa3HubpCVfJmZkOsDc2phgnHKbpqy8 Hwcf0ZvqD9sCEcvZgYrjqQ8vvm98SXbD06xZTrjAduKmKmD6dTpZ0CI5LTlxA7Y4w83J spOD9Ip1DofkGfBOXfyMDSZ8zsWJE/cYak95PESodgqHUVaGSMVKlgrM6IBXDVcBKSWq Fugg== X-Gm-Message-State: AOJu0YwCLqzOcXegyK/RweginGVG598SYf5thLFOnZXCjyFFd1CCW/dW IC4fwQVmwRPUP1t1MOTruYHuAP6qBCPMiZnbxsZKjibrBy1FX35z X-Gm-Gg: ASbGncuJuO8Pd5GBA3JQxf8izZRJzCmmkaLaApdU8BIaIfKXX/ND0u47x3z0W5TRGkF mCfHdVQ7wyhtNf+Pm3qKE474TgALGNT/t1sPv6wr7YlzaHkyreBdACR88Qp2EEG81hSGHabQTay 5ICHtbK9YnFt4sB2BGcsoIJ7/3d8/EJ+IxmSIoTUgr/F3SyGsAV7o4JhatTH7B5PMAyH94GsRDi n4ispitvxQ9/YVCffbsFnJjatp5ts2XV7Mej7pesgJsp/9UobIdGMbyKLGen6S+nWfP1ACi43Ri kwDdMzteZdimaT3We70XXlSRRC52M4lqzG5aDs66Kr3QeamUiw== X-Google-Smtp-Source: AGHT+IGlYqP+Lgr/2dYz/jXz8gKCKkF0InvrABMnwB2NLPAhKqv1G8+A85x1RI8DviV0SKlGTyQFZg== X-Received: by 2002:a05:600c:1e09:b0:434:f2af:6e74 with SMTP id 5b1f17b1804b1-438919136c6mr54087235e9.15.1737193915869; Sat, 18 Jan 2025 01:51:55 -0800 (PST) Received: from smtpclient.apple (adsl-132.176.58.137.tellas.gr. [176.58.137.132]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf327e213sm4692534f8f.81.2025.01.18.01.51.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jan 2025 01:51:54 -0800 (PST) From: Florents Tselai Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_CAFC83C3-71FB-4CA7-B6C0-67BE29A50BD0" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: jsonb_strip_nulls with arrays? Date: Sat, 18 Jan 2025 11:51:22 +0200 In-Reply-To: <00e32809-ae7e-46cf-9b33-7323f5fc7784@dunslane.net> Cc: pgsql-hackers To: Andrew Dunstan References: <4BCECCD5-4F40-4313-9E98-9E16BEB0B01D@gmail.com> <92de2543-de33-4092-9de7-b532a078353f@dunslane.net> <00e32809-ae7e-46cf-9b33-7323f5fc7784@dunslane.net> X-Mailer: Apple Mail (2.3826.300.87.4.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_CAFC83C3-71FB-4CA7-B6C0-67BE29A50BD0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 8 Jan 2025, at 6:45=E2=80=AFPM, Andrew Dunstan = wrote: >=20 >=20 >=20 > On 2024-09-17 Tu 4:53 PM, Florents Tselai wrote: >>=20 >>> We could, if we're going to do anything at all in this area. Another = possibility would be to provide a second optional parameter for = json{b}_strip_nulls. That's probably a better way to go. >>>=20 >> Here's a patch that adds that argument (only for jsonb; no json = implementation yet) >>=20 >>=20 >=20 > I think it looks sane. We're not stripping a top level null, which is = one thing I looked out for. >=20 > I think we need a json implementation as well, though. >=20 >=20 >=20 Thanks for having a Look, Andrew;=20 if there aren=E2=80=99t any other objections, I=E2=80=99ll come back = with a json implementation too.=20 > cheers >=20 >=20 >=20 > andrew >=20 >=20 >=20 > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com --Apple-Mail=_CAFC83C3-71FB-4CA7-B6C0-67BE29A50BD0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 8 Jan 2025, at 6:45=E2=80=AFPM, Andrew Dunstan = <andrew@dunslane.net> wrote:

=20 =20


On 2024-09-17 Tu 4:53 PM, Florents Tselai wrote:

We could, if we're going to do anything at all in = this area. Another possibility would be to provide a second optional parameter for json{b}_strip_nulls. That's probably a better way to go.

Here's a patch that adds that argument (only for jsonb; no json implementation yet)



I think it looks sane. We're not stripping a top level null, which is one thing I looked out for.

I think we need a json = implementation as well, = though.


Thanks for having a Look, = Andrew; 
if there aren=E2=80=99t any other objections, = I=E2=80=99ll come back with a json implementation = too. 

cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com

= --Apple-Mail=_CAFC83C3-71FB-4CA7-B6C0-67BE29A50BD0--