Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1po3x1-0004Yt-5N for pgsql-general@arkaria.postgresql.org; Sun, 16 Apr 2023 15:05:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1po3x0-00031Y-30 for pgsql-general@arkaria.postgresql.org; Sun, 16 Apr 2023 15:05:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1po3wz-00031O-OW for pgsql-general@lists.postgresql.org; Sun, 16 Apr 2023 15:05:57 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1po3wx-003Fem-6C for pgsql-general@lists.postgresql.org; Sun, 16 Apr 2023 15:05:57 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4PztmG0Xqbz9sSK; Sun, 16 Apr 2023 17:05:50 +0200 (CEST) Date: Sun, 16 Apr 2023 17:05:49 +0200 (CEST) From: Erik Wienhold To: =?UTF-8?Q?FOUTE_K=2E_Jaur=C3=A8s?= , PostgreSQL General Message-ID: <390317034.269615.1681657549620@office.mailbox.org> In-Reply-To: References: Subject: Re: Call a Normal function inside a Trigger Function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4PztmG0Xqbz9sSK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 16/04/2023 16:18 CEST FOUTE K. Jaur=C3=A8s wro= te: > > Is it possible to call a function inside a trigger=C2=A0function ? > Any idea or link are welcome. Thanks in advance Depends on what you want to do with the return value. Use PERFORM to ignor= e the result. [0] Use SELECT INTO to handle a single-row result. [1] =09PERFORM myfunc(); =09SELECT myfunc() INTO myresult; [0] https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL= -STATEMENTS-GENERAL-SQL [1] https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL= -STATEMENTS-SQL-ONEROW -- Erik