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 1tksPK-007Y1w-5S for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 22:19: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 1tksPI-00ERir-Dn for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 22:19: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 1tksPI-00ERhi-2Y for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 22:19:04 +0000 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tksPF-001qL3-34 for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 22:19:03 +0000 Received: by mail-qv1-xf44.google.com with SMTP id 6a1803df08f44-6e670d29644so1915326d6.3 for ; Wed, 19 Feb 2025 14:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1740003540; x=1740608340; darn=lists.postgresql.org; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=q53dTOroQRheD7gID1FkQFXCnMstXPqLWQhNg2RyTvY=; b=AIqP6rJEATOixUNBHzpFI5WJ3H4tY0tRN5q6wwsyZhjj6QppgPcOENlHNK4WpfAhrS HC5DDjvTaKVBE8e0Bfrz9NHm4szbeDSbhyNZzcPBT3b9IqZrgSqHBAj8TjwU24ZOEClt PG+Km+5HVEcVM34SAeQPOcr6P/3BOvlrnfddo5uyz7wF2kPmBJEHqbEJCoD+g9IrcP+s Eg++43oCxbHphLaivOYx+czQoc01gRjbnSLag8n+BaYapsQlvxAEXiPtJK5ZL89C1tY8 /r1HVe0+xq2X/9gjw+V1/0DworZ4gn35B2n59+oVHY3HXh1PzKijh2e7m3g2MPOS5oEE 2D2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740003540; x=1740608340; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=q53dTOroQRheD7gID1FkQFXCnMstXPqLWQhNg2RyTvY=; b=V8nFfvK/XalYQPo9px831C7gxgfXF13NVY5nvZ+H4jIWsT+AxuVcRiNK0uXRaXpNUB 2vEAUOlC7jFQkev6XwJGfFdyXP/UawIGPKUzueqgTjiQilSQeJOAdDJkdZNAweheBcOz 9kL1s8zbV9zVR2+dTaXgg+6CUSflQCzDuz3SOZ57I7FEZbED3Grz/sNMXGuVHw7dPaAd b8HX2EWQBYsJcvAsYWSb1j96hZ1OVqUOvDKwwht2qQfL8U3O/gjMlKAM81K5qVb6P4dC ECdQb+3JCtZuai7QaB8JZ3bq0QA1T3UTjOBHlsWHvqwOdR+il0ORALSM1osrPdHeigZR /iFg== X-Gm-Message-State: AOJu0YxQ4+K7gErw+vgL/f8+WhNP8asg34IXhmKIFFzjZ9AqX67GPziv R+jlvtqK2ocrSRcH1jY2b3t48BZD6xr12QbeAHYbpgJY07oh9U64eMf8iKS1xGg= X-Gm-Gg: ASbGncv+8YUupEW11VRS9ZnGaDF1knIfqGqiW374l4qK5BgW+GQ8iC59ev8w189naKs //gjVsgjfnraZ63kQ1FEjMpqi89tIsE2ypgGspdQOvaPR5Mp8g2LKnxgCo66Kb5p4isAEE/gn8E 7cQRajxVC91tRiVWD36LGOo0dxEkeAP7FaFsxs2SOprp60/KNgFyJOPuP+DbkmnOexeDLdHflC2 uRBoFWLBMXeWShPEfB0AijnyVATQ2Wwlothoj3cAu3LJuJf13S2zbFqcyVwr/1CVoYMfDF3N19h HI+lFt8ADzgi5sFuQWlpbEN7Qg== X-Google-Smtp-Source: AGHT+IF5W+rehdhShV0jHzkbwB9mVmNTeYYKvayH7wwEvJl/7ZutemCXnItUbztxhsuro1EZyIDJKA== X-Received: by 2002:a05:6214:20ad:b0:6d8:9cbf:d191 with SMTP id 6a1803df08f44-6e66cc915a3mr238461736d6.12.1740003539808; Wed, 19 Feb 2025 14:18:59 -0800 (PST) Received: from ?IPV6:2605:a601:a681:6b00::1cb? ([2605:a601:a681:6b00::1cb]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-6e65d785cb4sm79664476d6.43.2025.02.19.14.18.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2025 14:18:59 -0800 (PST) Content-Type: multipart/alternative; boundary="------------7ABa4WQGdwYvQ7H2YTqb0t2C" Message-ID: <2a3a38fb-818f-491f-bcd5-0c0672c874f2@dunslane.net> Date: Wed, 19 Feb 2025 17:18:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: jsonb_strip_nulls with arrays? To: Florents Tselai Cc: pgsql-hackers References: <4BCECCD5-4F40-4313-9E98-9E16BEB0B01D@gmail.com> <92de2543-de33-4092-9de7-b532a078353f@dunslane.net> <00e32809-ae7e-46cf-9b33-7323f5fc7784@dunslane.net> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0Levyv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wwWIQTkPlhGHfx8v0RpFaWZ+n/LWfw7gQUCZFlx 5wUJGVGAjgAKCRCZ+n/LWfw7gf+iB/4g8CPY5jihf5r/8EsoIGe2H+dpVmpPF8YGBzTIvCz/ fQoOq8AX/pE76QEuFnFZWfjw+wgBXgCVmkox2Eflkk6z4ND3pcwGZ6CfCxTQCDk/dij+2DQ4 6bmDCy/sBgcbz9mTpoLC11HLoPae6YN9nBNQRZDcEFEu54OaVOqlIdbA6m+POIBCXZdHOFc0 WoDTgxHRzC1jgQNidyd6tKqcsVJs0dzF0oKTmFFmUAqTdJO12LBuNA1rlqrR3EtpYk8B/wtS 5dIMD7Q8hwQpL+4C6GNpb6ZKnPkLi47pDOLhz2qBrqN+rqUEsT3YnExYpzj5yOBi+FlmV1Hw 49QYe1sn2ZPs In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------7ABa4WQGdwYvQ7H2YTqb0t2C Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025-02-19 We 4:23 PM, Florents Tselai wrote: > > >> On 18 Jan 2025, at 11:51 AM, Florents Tselai >> wrote: >> >> >> >>> On 8 Jan 2025, at 6:45 PM, Andrew Dunstan 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’t any other objections, I’ll 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.postgresql.org/52/ cheers andrew > > > -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------7ABa4WQGdwYvQ7H2YTqb0t2C Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


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


On 18 Jan 2025, at 11:51 AM, Florents Tselai <florents.tselai@gmail.com> wrote:



On 8 Jan 2025, at 6:45 PM, 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’t any other objections, I’ll 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.postgresql.org/52/


cheers


andrew





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