Re: Strange behaviour on function

From: Lorusso Domenico <domenico(dot)l76(at)gmail(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Strange behaviour on function
Date: 2023-07-05 20:03:39
Message-ID: CAJMpnG5bOOqmb1BAW=48osLLY_mFDhV_sEz21t9=MYYmmx_Exw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Erik, Adrian,

The trigger function is very long and complex (and not yet well
documented), but bind_action is a normal function callable everywhere, the
problem as discovered by Erik was in the null value contained in the hstore.

Anyway, when the ecosystem of functions will work correctly I can share, so
you can give me how improve :-D

Il giorno mer 5 lug 2023 alle ore 17:33 Erik Wienhold <ewie(at)ewie(dot)name> ha
scritto:

> > On 05/07/2023 17:16 CEST Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)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
>

--
Domenico L.

per stupire mezz'ora basta un libro di storia,
io cercai di imparare la Treccani a memoria... [F.d.A.]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message aarthi rajagopal 2023-07-06 04:52:32 Need help
Previous Message Lorusso Domenico 2023-07-05 19:56:21 Re: Strange behaviour on function