Re: Possible trigger bug? function call argument literalised

From: Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Possible trigger bug? function call argument literalised
Date: 2021-01-03 18:27:41
Message-ID: 20210103192741.Horde.RQ2ogTUGBJnpkIZYTeDRPO-@webmail.gelassene-pferde.biz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general


Quoting Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>:

>> Well, I guess, I can put the correct schema at installation, but
>> would have liked to have a more general approach. Furthermore, I
>> think this also implies that installation can only be done by psql.
>> :-s
>
> Why not grab the CURRENT_SCHEMA in the function?:
>
> DECLARE
> V_COUNT smallint;
> C_SCHEMA varchar := CURRENT_SCHEMA;

Thank you all for your lightning fast replies. I failed to set it at
install time. \gset cannot be used as bind variables in SQL. So, I try
retaining the restriction to that the function needs to be installed
in the same schema as the triggered table.

--
S/MIME Public Key: https://oc.gelassene-pferde.biz/index.php/s/eJuAUFONag6ofnH
Signal (Safer than WhatsApp): +49 1578 7723737
Threema (Safer than WhatsApp): A76MKH3J
Handys: +41 78 947 36 21 | +49 1578 772 37 37

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-01-03 18:32:13 Re: Possible trigger bug? function call argument literalised
Previous Message Adrian Klaver 2021-01-03 17:59:57 Re: Possible trigger bug? function call argument literalised