Re: ERROR: cannot pass more than 100 arguments to a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ján Máté <jan(dot)mate(at)inf-it(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: ERROR: cannot pass more than 100 arguments to a function
Date: 2020-04-08 21:34:08
Message-ID: 23664.1586381648@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?utf-8?B?SsOhbiBNw6F0w6k=?= <jan(dot)mate(at)inf-it(dot)com> writes:
> I understand that there is a need to limit the max. number of arguments for functions, but the current limit (100) is simply too restrictive for tables with large number of columns (according to my findings it is >250 depending on column types).

I'd suggest using one of the array- or aggregation-based approaches,
rather than insisting on writing it out with some hundreds of distinct
arguments. Any specific function-argument-count limit we might pick
would be too small for somebody, but those other methods can scale
much further. For example,

SELECT json_object(
array['a', 'col1',
'b', 'col2',
'c', 'col3']);
json_object
--------------------------------------------
{"a" : "col1", "b" : "col2", "c" : "col3"}
(1 row)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message raf 2020-04-08 21:34:13 Re: ERROR: cannot pass more than 100 arguments to a function
Previous Message Ján Máté 2020-04-08 21:04:27 ERROR: cannot pass more than 100 arguments to a function