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 1to4cf-005dzc-6R for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 17:58:06 +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 1to4cg-00Bxk8-71 for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 17:58:04 +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 1to4cf-00Bxjz-SJ for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 17:58:04 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1to4ca-000DMA-2J for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 17:58:04 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5e05717755bso3471471a12.0 for ; Fri, 28 Feb 2025 09:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740765481; x=1741370281; 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=NQHaFymC7bgf8rfq+0IjwcRcqgxLdsP2iEx2h428gJc=; b=Svh9hINQvQsEVlnVJigZgc37IqKEhuMnF3UB8uOTV0D6oJb85jXLThCdqceczYJxRv N4AH7pInHhkXDYNntl4c6mUP1nX+SzQZ0jEMkh1dvY/SIMWO4K8036h0GnnbTiJwCV+W epM+e5loq5eU4LJrupz2hgORJohJ9L6svJaE3Q+W35M4rh+2FP2nHUyVjxX4GgyMSZ+2 w+rJ9p7AhaiD9obCyeJttoC1dAoTfHYQa41tu4FpV3Q6k0tHvgTtglBZSwAYu/MiW8++ wrs1dCKaIcw7Ddm2IMlmrFX3xOiXMsbLuQgd5E8Sa8APIdjcYSXFLUsd3CR8PB8F/PEs W92A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740765481; x=1741370281; 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=NQHaFymC7bgf8rfq+0IjwcRcqgxLdsP2iEx2h428gJc=; b=bFOjQSM08Hd+CirFhy3aw5WBNd44hH3yYK0YKzLhuXITKs1a7KUs7Z3XLM1uM+8SY7 3ujmg1qDL1QV7INQ9Iz7Ej7r9aXZJEkvp4XBni1cBT/Vu5sYyBMk7uyOqY7weIh0Iheb S0cKsbDC7Z1OrT5kfbi4jCyrhUNdrnR6hoeFMjUxnQAKLr7vfX3tEg1BiZ1oniWF0ttk dYLCbNdDuMs7GI2lZZ1Hv9lKokV30oSp/PcP/hf9s/5HgmSaoYbgYAtEJLc8hOUdaQ48 7obnoDBIC56H9cPY5CGjn6xGunQa7QcSnZxiSVjav5r2S+d1tqnUf4QDQXqe/ZnMKd0P LgLg== X-Gm-Message-State: AOJu0YysqoI+VIBAOWahphjGXhhWzm5QuUF9cU39NXLy6IXlknBULE1p rl7HqqFpWmlPtiLol3d6JF677l9ZH47CR8Rhp4UdJg+Et34wt7pjY9B5fA== X-Gm-Gg: ASbGncsygckddTxdkPsnAJZocUqHvij5Qp67l5VTws6c6WGck/gIWmuvZY72exPYUc5 BgxrBkvZdNnqfEp/+x4wKyQ3g/JspC81ey2fBRYG059NY/X/+2Ms+WCRr9LpsoKupNx5r/L4UUc UFuJTsDBVIXRMPh3u8oRv+HjQw2Ei9aJyqx3EpIFqNDZh+9+TLY6V8+QkwkDmN//qm5bgXLP++m Kh+OE5S+ATSiFp4FHeM8ZpkJql7hHJYZhSIYn81usRNEalI0FSuUOnKglSwe9XFLT1ko0bJTu92 g/oJuWFFlJUP/iJbcnor7h4EMYLstv3jyWV3oHCAmh8oGwQCK/UN8hODoTQQ+Qx2kgEVCfJ+D6w 5tKI= X-Google-Smtp-Source: AGHT+IEw/b6UEdjq+yvLk5z34+Ov3hspA1qDH0IIEU7rruKgBrsy6P+XFuFWnP+NFBrmsvBf/O9ing== X-Received: by 2002:a17:907:98b:b0:aa6:a87e:f2e1 with SMTP id a640c23a62f3a-abf26824d2bmr508396266b.56.1740765480855; Fri, 28 Feb 2025 09:58:00 -0800 (PST) Received: from smtpclient.apple (adsl-72.176.58.139.tellas.gr. [176.58.139.72]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abf0c0dc168sm325798666b.70.2025.02.28.09.57.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2025 09:57:59 -0800 (PST) From: Florents Tselai Message-Id: <90F4B634-BAD4-45E0-8D0A-4A02CC37D4E2@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_0A7CD6B9-7BBE-4127-BAD1-01DC71D6F20C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: jsonb_strip_nulls with arrays? Date: Fri, 28 Feb 2025 19:57:27 +0200 In-Reply-To: <2a3a38fb-818f-491f-bcd5-0c0672c874f2@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> <2a3a38fb-818f-491f-bcd5-0c0672c874f2@dunslane.net> X-Mailer: Apple Mail (2.3826.400.131.1.6) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_0A7CD6B9-7BBE-4127-BAD1-01DC71D6F20C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 20 Feb 2025, at 12:18=E2=80=AFAM, Andrew Dunstan = wrote: >=20 >=20 >=20 > On 2025-02-19 We 4:23 PM, Florents Tselai wrote: >>=20 >>=20 >>> On 18 Jan 2025, at 11:51=E2=80=AFAM, Florents Tselai = wrote: >>>=20 >>>=20 >>>=20 >>>> 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 >>=20 >> Attached is a v2 patch with the missing json implementation.=20 >> jsonb one remains the same. >=20 >=20 > Please add this to the next Commitfest at = https://commitfest.postgresql.org/52/ >=20 Added ; thanks https://commitfest.postgresql.org/patch/5260/ >=20 > cheers >=20 >=20 >=20 > andrew >=20 >=20 >=20 >>=20 >>=20 >>=20 > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com --Apple-Mail=_0A7CD6B9-7BBE-4127-BAD1-01DC71D6F20C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 20 Feb 2025, at 12:18=E2=80=AFAM, Andrew Dunstan = <andrew@dunslane.net> wrote:

=20 =20


On 2025-02-19 We 4:23 PM, Florents Tselai wrote:


On 18 Jan 2025, at 11:51=E2=80=AFAM, Florents Tselai <florents.tselai@gmail.com>= ; wrote:



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


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. 

Attached is a v2 patch with the missing json implementation. 
jsonb one remains the same.



Please add this to the next Commitfest at https://commitfest.postgres= ql.org/52/


Added ; = thanks

= --Apple-Mail=_0A7CD6B9-7BBE-4127-BAD1-01DC71D6F20C--