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 1wwLZS-001vdd-2f for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 15:17:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwLZQ-00GNDc-23 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 15:17:45 +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 1wwLZQ-00GNDT-14 for pgsql-hackers@lists.postgresql.org; Tue, 18 Aug 2026 15:17:45 +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 1wwLZL-00000001Q1r-12UE for pgsql-hackers@lists.postgresql.org; Tue, 18 Aug 2026 15:17:45 +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 67IFHXwl1382172; Tue, 18 Aug 2026 11:17:33 -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> <756684.1786981296@sss.pgh.pa.us> <1132241.1786999322@sss.pgh.pa.us> Comments: In-reply-to Andrey Rachitskiy message dated "Tue, 18 Aug 2026 16:58:08 +0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1382170.1787066253.1@sss.pgh.pa.us> Date: Tue, 18 Aug 2026 11:17:33 -0400 Message-ID: <1382171.1787066253@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrey Rachitskiy writes: > Tom, I've put together a SvGETMAGIC version on top of your last patch. > Thoughts? I've not read the whole thing, but I noticed /* * Convert a HE (hash entry) key to a cstr in the current database encoding. * The result is palloc'd. + * + * Uses FREETMPS, so call this before hv_iterval() if both are needed. */ static inline char * hek2cstr(HE *he) and you had a similar comment in your earlier draft. I think this is nonsense though. hek2cstr does the full ENTER; SAVETMPS; FREETMPS; LEAVE; dance, so unless I totally misunderstand that API, it's destroying only its own temps not any pre-existing ones. Also, if there actually is an ordering dependency there, how is the existing coding working (where the two callers of hek2cstr do so in randomly different orders?) I changed that ordering in my patch only for cosmetic reasons, not because I expect it to make a difference. regards, tom lane