pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ján Máté <jan.mate@inf-it.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: ERROR: cannot pass more than 100 arguments to a function
Date: Wed, 08 Apr 2020 17:34:08 -0400
Message-ID: <23664.1586381648@sss.pgh.pa.us> (raw)
In-Reply-To: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com>
References: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com>

=?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 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





view thread (3+ messages)  latest in thread

Message-ID: <23664.1586381648@sss.pgh.pa.us>
Permalink:  ../23664.1586381648@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23664.1586381648@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jan.mate@inf-it.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: ERROR: cannot pass more than 100 arguments to a function
  In-Reply-To: <23664.1586381648@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox