Re: Call a Normal function inside a Trigger Function - Mailing list pgsql-general

From Erik Wienhold
Subject Re: Call a Normal function inside a Trigger Function
Date
Msg-id 390317034.269615.1681657549620@office.mailbox.org
Whole thread Raw
In response to Call a Normal function inside a Trigger Function  (FOUTE K. Jaurès <jauresfoute@gmail.com>)
List pgsql-general
> On 16/04/2023 16:18 CEST FOUTE K. Jaurès <jauresfoute@gmail.com> wrote:
>
> Is it possible to call a function inside a trigger function ?
> Any idea or link are welcome. Thanks in advance

Depends on what you want to do with the return value.  Use PERFORM to ignore
the result. [0]  Use SELECT INTO to handle a single-row result. [1]

    PERFORM myfunc();
    SELECT 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



pgsql-general by date:

Previous
From:
Date:
Subject: Suppress logging of "pg_hba.conf rejects connection for host"
Next
From: Erik Wienhold
Date:
Subject: Re: Suppress logging of "pg_hba.conf rejects connection for host"