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 1v0YkC-00Fi1S-DG for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Sep 2025 05:05:44 +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 1v0YkA-00GqL2-W3 for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Sep 2025 05:05:43 +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 1v0YkA-00GqKs-Ng for pgsql-bugs@lists.postgresql.org; Mon, 22 Sep 2025 05:05:42 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v0Yk8-001hp7-1s for pgsql-bugs@postgresql.org; Mon, 22 Sep 2025 05:05:41 +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 58M55dI42811277; Mon, 22 Sep 2025 01:05:39 -0400 From: Tom Lane To: myzhen cc: pgsql-bugs@postgresql.org Subject: Re: coredump of language internal function In-reply-to: References: Comments: In-reply-to myzhen message dated "Mon, 22 Sep 2025 12:56:10 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2811275.1758517539.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 22 Sep 2025 01:05:39 -0400 Message-ID: <2811276.1758517539@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk myzhen writes: > When creating a function using language internal, if the parameters or f= unction attributes of the alias function are different from those of the i= nternal function, they are not checked during creation and may cause a cor= dump when called. We have always considered that this is programmer error. > I didn't find this mentioned in the manual, so I'm not sure if this is a= problem, but it seems like it might be better to do a check when creating= the function. If you have an idea about how such a check could be done, it would be worth discussing that. But it seems pretty unlikely to me that there is any portable way to identify externally what data types a compiled function is expecting to receive. regards, tom lane