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.96) (envelope-from ) id 1wvzT5-001fgq-0z for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2026 15:41:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wvzT2-00BXIc-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2026 15:41:41 +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.96) (envelope-from ) id 1wvzT2-00BXIT-1C for pgsql-hackers@lists.postgresql.org; Mon, 17 Aug 2026 15:41:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wvzT0-00000001EkA-3ee4 for pgsql-hackers@lists.postgresql.org; Mon, 17 Aug 2026 15:41:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 67HFfaZb756685; Mon, 17 Aug 2026 11:41:36 -0400 From: Tom Lane To: Andrey Rachitskiy cc: andrew@dunslane.net, pgsql-hackers@lists.postgresql.org Subject: Re: Residual cleanups for tied objects in PL/Perl In-reply-to: References: <569769.1786901901@sss.pgh.pa.us> <579928.1786912017@sss.pgh.pa.us> Comments: In-reply-to Andrey Rachitskiy message dated "Mon, 17 Aug 2026 11:05:56 +0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <756683.1786981296.1@sss.pgh.pa.us> Date: Mon, 17 Aug 2026 11:41:36 -0400 Message-ID: <756684.1786981296@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrey Rachitskiy writes: > I have attached v2. v2 looks like a bunch of very random changes. I would like to see more consistency in the code, ie exactly one pattern for iterating through hashes and exactly one pattern for iterating through arrays. We'd not have had the original infinite-loop problem in the first place if plperl_func_handler() hadn't seen fit to use av_fetch() in a way randomly different from every other usage. We still have multiple patterns for iterating through hashes: why do a couple of places use hv_iternextsv when the others don't? And why do we use hek2cstr in some places and not others? (oh, and for extra credit: why is there a second call of hv_iterinit in plperl_build_tuple_result and plperl_modify_tuple?) I think we'd be well advised to clean up that inconsistency, and then inject tied-object handling in the same way in each loop. regards, tom lane