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

From: intmail01 <intmail01(at)gmail(dot)com>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Function can not use the 'NEW' variable as a direct parameter inside trigger function?
Date: 2024-04-05 17:17:43
Message-ID: CAKJANSC3sJ+aUrPptdh10+KG+eD9p6YHUJ5O-X5yr-+5v2VNZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

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.

I have to use trick by using a temporary variable to run the code :

theVariable MyTableStruct;
theVariable = NEW ;
myFunction(theVariable) ;

Thanks

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2024-04-05 19:21:10 Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function?
Previous Message Tom Lane 2024-04-05 16:37:47 Re: Help with error date_trunc() function.