pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lorusso Domenico <domenico.l76@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Strange behaviour on function
Date: Wed, 5 Jul 2023 17:33:44 +0200 (CEST)
Message-ID: <2063713102.832030.1688571224669@office.mailbox.org> (raw)
In-Reply-To: <84a4f250-e12f-9dd8-bf97-c794f6b909f5@aklaver.com>
References: <CAJMpnG4byAZMOd-12Pxn7KcptJpi4MJCc-U-tS8KZNSE_6YkKg@mail.gmail.com>
	<84a4f250-e12f-9dd8-bf97-c794f6b909f5@aklaver.com>

> On 05/07/2023 17:16 CEST Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
> https://www.postgresql.org/docs/current/plpgsql-trigger.html
>
> 1)
> "A trigger function must return either NULL or a record/row value having
> exactly the structure of the table the trigger was fired for."
>
> 2) I am not seeing where you use:
>
> "TG_ARGV[]
>
>      Data type array of text; the arguments from the CREATE TRIGGER
> statement. The index counts from 0. Invalid indexes (less than 0 or
> greater than or equal to tg_nargs) result in a null value."
>
> So I don't see how sqlstr is being set?

Domenico did not provide the trigger definition, only function bind_action
which he calls from a trigger function.  Also bind_action cannot be a trigger
function because it does not return trigger.

--
Erik





view thread (6+ messages)  latest in thread

Message-ID: <2063713102.832030.1688571224669@office.mailbox.org>
Permalink:  ../2063713102.832030.1688571224669@office.mailbox.org/
Also on:    postgresql.org/message-id/2063713102.832030.1688571224669@office.mailbox.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ewie@ewie.name, adrian.klaver@aklaver.com, domenico.l76@gmail.com
  Subject: Re: Strange behaviour on function
  In-Reply-To: <2063713102.832030.1688571224669@office.mailbox.org>
  References: <CAJMpnG4byAZMOd-12Pxn7KcptJpi4MJCc-U-tS8KZNSE_6YkKg@mail.gmail.com> <84a4f250-e12f-9dd8-bf97-c794f6b909f5@aklaver.com> <2063713102.832030.1688571224669@office.mailbox.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox