Обсуждение: Creating trigger with optional arg?
Is it possible to have a variable number of elements in TG_ARGV in a trigger?
create trigger tg_mytrig after insert on mytable for each row execute procedure my_trigger('opt1', 'opt2', 'opt3');
create trigger tg_mytrig after insert on mytable for each row execute procedure my_trigger('opt1', 'opt2', 'opt3', 'optional opt4');
With some kind of null check on TG_ARGV[4] inside the trigger.
On Wed, Jul 22, 2020 at 9:49 AM Wells Oliver <wells.oliver@gmail.com> wrote:
Is it possible to have a variable number of elements in TG_ARGV in a trigger?
see: default_expr
I would expect it to work though I have not tried it myself.
David J.
I think this is a little different given I'm using the array TG_ARGV and not defined parameters in the signature though, correct?
On Wed, Jul 22, 2020 at 9:59 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Jul 22, 2020 at 9:49 AM Wells Oliver <wells.oliver@gmail.com> wrote:Is it possible to have a variable number of elements in TG_ARGV in a trigger?see: default_exprI would expect it to work though I have not tried it myself.David J.
--
Wells Oliver
wells.oliver@gmail.com
wells.oliver@gmail.com