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 1teseM-00GAxi-Ng for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 09:21:51 +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 1teseL-00Brnm-5r for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 09:21:49 +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.94.2) (envelope-from ) id 1tesc6-00BoQ4-1o for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 09:19:30 +0000 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tesc1-002vIG-3D for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 09:19:29 +0000 Received: from mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:4310:0:640:bf36:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 4EF4460A50; Mon, 3 Feb 2025 12:19:22 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6b8:b081:b5c0::1:32]) by mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id JJfelq1IlKo0-Sulo9oW3; Mon, 03 Feb 2025 12:19:21 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1738574361; bh=V5wR7nc9JCG4BHIuqwCj0ZE79ijjCrEbtHBTuC++F8s=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=CLS68LvZ2Y/wdoj9+tya+DGeTn10z4WpLOhAavuXNjsmZ8BeK6iI+zDk5XmTj9z0l n2jizSivnPTcSCam+su7+EBPEkX1dgv+X7eWjsL4FLsjVOivaxmAJQWoujsqs+zz7P npLdxJXu1nslLz7SR1pO2dvRVuv9XK1meBkc31Zg= Authentication-Results: mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: Using Expanded Objects other than Arrays from plpgsql From: Andrey Borodin In-Reply-To: <256915.1738533419@sss.pgh.pa.us> Date: Mon, 3 Feb 2025 14:19:09 +0500 Cc: Pavel Borisov , Michel Pelletier , Pavel Stehule , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <932C9840-63D6-469D-9C65-1B1A14594D29@yandex-team.ru> References: <1342498.1729444411@sss.pgh.pa.us> <1445998.1729482404@sss.pgh.pa.us> <2062830.1729625620@sss.pgh.pa.us> <2265411.1729699470@sss.pgh.pa.us> <2354718.1729737539@sss.pgh.pa.us> <2581216.1729794746@sss.pgh.pa.us> <1948345.1730500073@sss.pgh.pa.us> <3797606.1732045516@sss.pgh.pa.us> <1417389.1736964543@sss.pgh.pa.us> <3363452.1737483125@sss.pgh.pa.us> <0AC229FA-A3F1-43FD-B0DC-A46A73FEAFF7@yandex-team.ru> <931398.1737905825@sss.pgh.pa.us> <38A31221-C1C4-4846-9709-D66ACD76E87A@yandex-team.ru> <46876.1737918281@sss.pgh.pa.us> <3682021.1738288421@sss.pgh.pa.us> <256915.1738533419@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3776.700.51.11.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 3 Feb 2025, at 02:56, Tom Lane wrote: >=20 > I decided to see what would happen if we tried to avoid the code > duplication in pl_funcs.c by making some "walker" infrastructure > akin to expression_tree_walker. While that doesn't seem useful > for the dump_xxx functions, it works very nicely for the free_xxx > functions and now for the mark_xxx ones as well. pl_funcs.c > nets out about 400 lines shorter than in the v4 patch. The > code coverage score for the file is still awful :-(, but that's > because we're not testing the dump_xxx functions at all. >=20 > PFA v5. The new 0001 patch refactors the free_xxx infrastructure > to create plpgsql_statement_tree_walker(), and then in what's now > 0003 we can use that instead of writing a lot of duplicate code. Pre-preliminary refactoring looks good to me, as the rest of the patch = set. (Well, maybe paramarg2 resonates a bit, just from similarity with = varchar2) ecpg tests seem to fail on Windows[0], but looks like it's not related = to this thread. Best regards, Andrey Borodin. [0] https://cirrus-ci.com/task/4835794898124800=