Re: Allow any[] as input arguments for sql/plpgsql functions to mimic format()

2019-04-22 Thread Tom Lane
=?UTF-8?Q?Micha=c5=82_=22phoe=22_Herda?= writes: > My reasoning in this case is - if we allow the any[] type to only be > passed to other functions that accept any[], and disallow any kind of > other operations on this array (such as retrieving its elements or > modifying it), I do not yet see any

Re: Allow any[] as input arguments for sql/plpgsql functions to mimic format()

2019-04-22 Thread Pavel Stehule
Hi po 22. 4. 2019 v 19:20 odesílatel Michał "phoe" Herda napsal: > Hey! > > OK - thank you for the update and the explanation. > > My reasoning in this case is - if we allow the any[] type to only be > passed to other functions that accept any[], and disallow any kind of other > operations on th

Re: Allow any[] as input arguments for sql/plpgsql functions to mimic format()

2019-04-22 Thread phoe
Hey! OK - thank you for the update and the explanation. My reasoning in this case is - if we allow the any[] type to only be passed to other functions that accept any[], and disallow any kind of other operations on this array (such as retrieving its elements or modifying it), I do not yet see any

Re: Allow any[] as input arguments for sql/plpgsql functions to mimic format()

2019-04-22 Thread Pavel Stehule
Hi po 22. 4. 2019 v 11:27 odesílatel Michał "phoe" Herda napsal: > Hey everyone, > > I am writing a plpgsql function that (to greatly simplify) raises an > exception with a formatted* message. Ideally, I should be able to call > it with raise_exception('The person %I has only %I bananas.', 'Fred

Allow any[] as input arguments for sql/plpgsql functions to mimic format()

2019-04-22 Thread phoe
Hey everyone, I am writing a plpgsql function that (to greatly simplify) raises an exception with a formatted* message. Ideally, I should be able to call it with raise_exception('The person %I has only %I bananas.', 'Fred', 8), which mimics the format(text, any[]) calling convention. Here is wher