Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlFX0-0008Ol-5S for pgsql-bugs@arkaria.postgresql.org; Sun, 01 May 2022 19:46:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlFWy-0006zb-Hv for pgsql-bugs@arkaria.postgresql.org; Sun, 01 May 2022 19:46:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlFWy-0006zS-9n for pgsql-bugs@lists.postgresql.org; Sun, 01 May 2022 19:46:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlFWv-0007cy-Or for pgsql-bugs@lists.postgresql.org; Sun, 01 May 2022 19:46:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 241Jko9F1699528; Sun, 1 May 2022 15:46:50 -0400 From: Tom Lane To: "David G. Johnston" cc: d , PostgreSQL mailing lists Subject: Re: ERROR: type of parameter 1 (fruit2) does not match that when preparing the plan (fruit1) In-reply-to: References: <20220430162319.67986afa@metairie.davudsplace.net> <1683365.1651424937@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Sun, 01 May 2022 12:34:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1699526.1651434410.1@sss.pgh.pa.us> Date: Sun, 01 May 2022 15:46:50 -0400 Message-ID: <1699527.1651434410@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Sun, May 1, 2022 at 10:08 AM Tom Lane wrote: >> Maybe we could improve this situation by treating a "record" parameter >> as polymorphic, though that might cause some odd inconsistencies with >> plpgsql's historical treatment of "record" local variables. > The extent of needing to treat "record" as polymorphic-like seems like it > would be limited to resolve_polymorphic_argtype in funcapi.c. Namely, in > computing the hash key for the compiled hash entry for the function. > Similar to how we append the trigger oid in compute_function_hashkey in > pl.compile (which ultimately calls the former) so trigger invocations > become per-table. I'm hesitant to touch funcapi.c for this; the scope of potential side-effects becomes enormous as soon as you do. regards, tom lane