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 1rsp7j-009VKb-N7 for pgsql-sql@arkaria.postgresql.org; Fri, 05 Apr 2024 19:21:16 +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 1rsp7i-004YVh-Gx for pgsql-sql@arkaria.postgresql.org; Fri, 05 Apr 2024 19:21:14 +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 1rsp7i-004YVZ-81 for pgsql-sql@lists.postgresql.org; Fri, 05 Apr 2024 19:21:14 +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.94.2) (envelope-from ) id 1rsp7f-000nMx-Tv for pgsql-sql@lists.postgresql.org; Fri, 05 Apr 2024 19:21:13 +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 435JLA5d1404955; Fri, 5 Apr 2024 15:21:10 -0400 From: Tom Lane To: intmail01 cc: pgsql-sql@lists.postgresql.org Subject: Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function? In-reply-to: References: Comments: In-reply-to intmail01 message dated "Fri, 05 Apr 2024 20:17:43 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1404953.1712344870.1@sss.pgh.pa.us> Date: Fri, 05 Apr 2024 15:21:10 -0400 Message-ID: <1404954.1712344870@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk intmail01 writes: > Why a function can not pass the 'NEW' variable as a direct parameter ? > When I use myFunction(NEW) inside a trigger function an error appears : > pq_driver: [PGRES_FATAL_ERROR]ERROR: function myFunction(MyTableStruct) > does not exist > LINE 1: ...myFunction(NEW)... > ^ > HINT: No function matches the given name and argument types. You might > need to add explicit type casts. That doesn't look like NEW's fault. You lack a suitable function to be called. regards, tom lane