Re: ERROR: cannot pass more than 100 arguments to a function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: ERROR: cannot pass more than 100 arguments to a function
Date
Msg-id 23664.1586381648@sss.pgh.pa.us
Whole thread Raw
In response to ERROR: cannot pass more than 100 arguments to a function  (Ján Máté <jan.mate@inf-it.com>)
List pgsql-bugs
=?utf-8?B?SsOhbiBNw6F0w6k=?= <jan.mate@inf-it.com> writes:
> I understand that there is a need to limit the max. number of arguments for functions, but the current limit (100) is
simplytoo 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



pgsql-bugs by date:

Previous
From: Ján Máté
Date:
Subject: ERROR: cannot pass more than 100 arguments to a function
Next
From: raf
Date:
Subject: Re: ERROR: cannot pass more than 100 arguments to a function