Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMIL0-0006gf-08 for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Apr 2020 21:34:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMIKy-0000xU-2q for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Apr 2020 21:34:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMIKx-0000xL-Rp for pgsql-bugs@lists.postgresql.org; Wed, 08 Apr 2020 21:34:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMIKq-0003WI-A1 for pgsql-bugs@lists.postgresql.org; Wed, 08 Apr 2020 21:34:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 038LY8tI023665; Wed, 8 Apr 2020 17:34:08 -0400 From: Tom Lane To: =?utf-8?B?SsOhbiBNw6F0w6k=?= cc: pgsql-bugs@lists.postgresql.org Subject: Re: ERROR: cannot pass more than 100 arguments to a function In-reply-to: References: Comments: In-reply-to =?utf-8?B?SsOhbiBNw6F0w6k=?= message dated "Wed, 08 Apr 2020 23:04:27 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23663.1586381648.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 08 Apr 2020 17:34:08 -0400 Message-ID: <23664.1586381648@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?utf-8?B?SsOhbiBNw6F0w6k=3D?=3D 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 t= ables with large number of columns (according to my findings it is >250 de= pending 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