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.98.2) (envelope-from ) id 1xRCEJ-00000000mBt-47ef for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Nov 2026 17:35:27 +0000 Received: from localhost ([127.0.0.1]:41362 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xRCEI-0000000CIDp-1F7I for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Nov 2026 17:35:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:44846) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRCEI-0000000CIDh-0DjO for pgsql-bugs@lists.postgresql.org; Wed, 11 Nov 2026 17:35:26 +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 1xRCEG-00000000VOO-0WaM for pgsql-bugs@lists.postgresql.org; Wed, 11 Nov 2026 17:35:26 +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 6ABHZLkU3249683; Wed, 11 Nov 2026 12:35:21 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6ABHZLkU3249683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1794418521; bh=xNEtgJBupHL/sHSwZrhsXLS19BLiFPFifrtNrc4MIyI=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=VXOiV2zSr4x1OVRPDvk/YO6jwB27uyLgNQUQDOsmoMnj/eAKiu/hrbFI9m9kyy0+u i/pCfH5zw41uio9KCHMf+QCM2vuXEZWY0oJcSFhvatYYFnpUl6gdwGXxYadieY2J8t X5+y0C9VDFokJb9bTAF5w6k2xgRQuSHFTJM149EA= From: Tom Lane To: shihao zhong cc: Marcos Castedo , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19816: PL/Python SD dictionary is split by input collation in 19rc1 In-reply-to: <3245516.1794415242@sss.pgh.pa.us> References: <19816-921b5cbc3ee63146@postgresql.org> <2491842.1794252108@sss.pgh.pa.us> <3245516.1794415242@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 11 Nov 2026 11:40:42 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3249681.1794418521.1@sss.pgh.pa.us> Date: Wed, 11 Nov 2026 12:35:21 -0500 Message-ID: <3249682.1794418521@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > So I'm now coming around to the conclusion that bug compatibility > with the old behavior is the way to go. Maybe we will rethink > that when/if we get around to supporting polymorphic arguments, > but we don't have to make a decision about that today. If we > split off a separate hashtable as Shihao's v1 patch does, then > we've successfully decoupled the SD behavior from funccache.c's > rules, and we will be free to go either way when the time comes. > So I think Shihao's patch is the right thing (at least approximately, > I haven't read it in detail), and I'll move forward with that. Okay, so I started looking at the patch and immediately realized that it's set up to replace SD any time the function is redefined. I think that's taking bug-compatibility with the old behavior a bit too far: you certainly would not get that impression from the manual's description. I propose we drop that behavior and just run with the function OID and trigger relation as hash keys. As a minor criticism, I find it odd to make PLy_procedure_compile sometimes create the SD dictionary and sometimes not. There are only two callers, so I'm more inclined to require both callers to handle that. regards, tom lane