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 1rsnBg-009ICZ-Cc for pgsql-sql@arkaria.postgresql.org; Fri, 05 Apr 2024 17:17:12 +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 1rsnBf-003PSU-CI for pgsql-sql@arkaria.postgresql.org; Fri, 05 Apr 2024 17:17:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rsnBf-003PSM-3C for pgsql-sql@lists.postgresql.org; Fri, 05 Apr 2024 17:17:11 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rsnBZ-000pAQ-D2 for pgsql-sql@lists.postgresql.org; Fri, 05 Apr 2024 17:17:10 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-229661f57cbso1205548fac.1 for ; Fri, 05 Apr 2024 10:17:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712337422; x=1712942222; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=9lYMGNDdYUqVO9QK81Er9RlcK+UM7Xf4TdP1A9wG8Y8=; b=VBBVQAEjm3IzRbe8d1+Y1h+6tG23aen0fTFnqx++V0BerQDgQpchOkG7MqKJq4S2M6 ct0YSnaER8XxblE7tWWRvOIlqkbTZVYXqrmioeTT4wgnsyWw5CfdeiSzV4vOBjPZgg6q RWMNQ2tdSDQ+bgCEkVTOPoAM9+wWQ4lxZkVzlm7B+r7J2HUzx8bccQ8ixT6P1tVhvS2N +dtdvKnw0teB9HkrO9j8wEl0+2SqVnuoRl4ei6TUXT/Yjci8Yt6t/dJaSjpjSDKl4nJU QlYl0zHdjkv+ebgzQYCwFqkOV4s7fvxmgFDye/IFlAy0CKWF+LoOARPcBksvJCkJB82s IiKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712337422; x=1712942222; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9lYMGNDdYUqVO9QK81Er9RlcK+UM7Xf4TdP1A9wG8Y8=; b=Bk0qNhxCez2mMt0yNwlVXr0U5YRlNNP4WALN/UGNzAdxHpcd55VzLMl52AYt8elI89 HJepMtC5Uj3UGcUD47fhtnnipOe5Gt1jWyzQKsx01KTt68U9S5IxmdbWHFcVfSlEjAP1 MqnATjiInSjKPoyyaSgq8TuRxAhjAqj6AkRpcsu3mzRyhoCZr+3yrwa+P3hUA1bdxHLq adR1F7fWl/5Zb2IxaaEpkSh9QqxiJGAbMzuwO+Bk7xL5tfOUfWklL4UWDW7K8VWqGcjL 0OQDwGUXHNC84qFdvam1w8kzFdJHQ/OqPa65yfipr5CWjiXP7h2/9/+c0td4qQ//gXF4 wuzg== X-Gm-Message-State: AOJu0Yw+WFMz/zcdhqkIY1denIzBGU15/2CuKRqZvQnU6PHzFdMz4j0i wzHOHh9Dfn670stEl0tahNl6ouDLV5mfZlhX4vvv5hcGgG+7DFngZ+mJLKV2OBxqmp1vuFlKnZc vjjq9z7T3jEmvTNUx0awDSi7EZlrbzbr4n8u5ddiR X-Google-Smtp-Source: AGHT+IF/1oqHeYaYhTMQY2nB7tHg0HTsZ3qfujrH/q7zoDdJQv6bSDxTr16q1hexv2sQ/Nosf2EU5AIRMP9zDUvKQT0= X-Received: by 2002:a05:6870:3753:b0:22e:b952:6d2a with SMTP id a19-20020a056870375300b0022eb9526d2amr2474006oak.34.1712337422463; Fri, 05 Apr 2024 10:17:02 -0700 (PDT) MIME-Version: 1.0 From: intmail01 Date: Fri, 5 Apr 2024 20:17:43 +0300 Message-ID: Subject: Function can not use the 'NEW' variable as a direct parameter inside trigger function? To: pgsql-sql@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000cd515206155c9ffe" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000cd515206155c9ffe Content-Type: text/plain; charset="UTF-8" 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 --000000000000cd515206155c9ffe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Why a function can not pass the 'NEW' v= ariable as a direct parameter ?
When I use myFunction(NEW) inside a trig= ger function an error appears :

pq_driver: [PGRES_FATAL_ERROR]ERROR:= =C2=A0function myFunction(MyTableStruct) does not exist
LINE 1: ...myFu= nction(NEW)... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ^
HINT: =C2=A0No function matches the given name and argument types.= You might need to add explicit type casts.

I have to use trick by u= sing a temporary variable to run the code :

theVariable MyTableStruc= t;
theVariable =3D NEW ;
myFunction(theVariable) ;

Thanks --000000000000cd515206155c9ffe--