pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ján Máté <jan.mate@inf-it.com>
To: pgsql-bugs@lists.postgresql.org
Subject: ERROR: cannot pass more than 100 arguments to a function
Date: Wed, 8 Apr 2020 23:04:27 +0200
Message-ID: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com> (raw)

Hi PostgreSQL,

I noticed an interesting problem with the default max. number of function arguments, especially related to JSON processing.

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).

A simple example:

- I have a table with 70 columns

- I want to select the most simple JSON output from that table:

SELECT
json_build_object(
'a', "col1",
'b', "col2",
'c', "col2",
...
)
FROM "schema"."table";

- with the 100 arguments limit I can select only 50 columns - 50 x (jsonKeyName + ColumnName) = 100 arguments

- if the limit of columns in the table is >250, why I cannot select at least 250 columns using the built-in json_build_object(...) function?


Please someone consider to increase the default limit from 100 to at least 500 (2x max. number of columns) for json_build_object(...) and other similar JSON functions.


Kind regards,


JM

view thread (3+ messages)  latest in thread

Message-ID: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com>
Permalink:  ../E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com/
Also on:    postgresql.org/message-id/E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jan.mate@inf-it.com
  Subject: Re: ERROR: cannot pass more than 100 arguments to a function
  In-Reply-To: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com>
  References: <E0EF3255-BC7C-4368-84CD-DF75325901B9@inf-it.com>

* 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