Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: intmail01 <intmail01(at)gmail(dot)com>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function?
Date: 2024-04-05 19:21:10
Message-ID: 1404954.1712344870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

intmail01 <intmail01(at)gmail(dot)com> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message kunwar singh 2024-04-27 13:03:16 How to pass arguments in postgres to sql scripts.
Previous Message intmail01 2024-04-05 17:17:43 Function can not use the 'NEW' variable as a direct parameter inside trigger function?