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 1l4Om1-0001CQ-De for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2021 13:52:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4Om0-0003fR-3H for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2021 13:52:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4Olz-0003fK-AG for pgsql-admin@lists.postgresql.org; Tue, 26 Jan 2021 13:52:47 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4Olw-0005ub-VV for pgsql-admin@postgresql.org; Tue, 26 Jan 2021 13:52:46 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id C41FB7D8; Tue, 26 Jan 2021 08:52:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 26 Jan 2021 08:52:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=MNneSnMX7OreSgCu7IDsL3wbc645EO14/Lf7pgWXteY=; b=IUmiJ/Xw UTv31QRSY9gp+APhTI1a/EFR1r1+R2RcEWvbzPav2E9NpRlpozqHxDiA0VDaHbeI afnziRzlPFLGwZWVhwEjK3sF89wLgIRivHTajwI0vDELap9TNL+uoIfuUrj25pLj ngKrsmbCzs21GtWHm2ic1jwpxCdDqt92puRGRxgG/+31Swmc9cnN9CiMv2KES+Si E+L13Mftv36gyksa89KWtj6CsvbzZyQzsqQ0DpLNvjAhBl8vCVU6raazhCQ6dIWg ResPwu3lbhuTS+tMCf+6ZSy2NodjILBtKuWxRFZQWVhtzxum7v6sHeGGhx2nJQe/ r02jC/wvhRwgtA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehgdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtreejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvleegkeeluedvvddtkefhgefgteehueekheettdehtdef tdevleekleegleeikeenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id E15051080059; Tue, 26 Jan 2021 08:52:40 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 045A02A0FAE; Tue, 26 Jan 2021 10:52:39 -0300 (-03) Date: Tue, 26 Jan 2021 10:52:38 -0300 From: Alvaro Herrera To: Wells Oliver Cc: pgsql-admin Subject: Re: json_build_object, numeric types, and function limits on 100 arguments Message-ID: <20210126135238.GA20826@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Jan-25, Wells Oliver wrote: > Hi. I am trying to build a Large JSON Object, and running into issues with > the function limit on 100 arguments. I know I can use ARRAY[] to get around > this, but I can't mix text and numeric types, which I need to do to have a > nicely usable JSON object. > > I know I can do this: json_build_object('somekey', 1.0, 'someotherkey', > 2.0) but cannot put more than 100. Maybe you can use the jsonb || jsonb operator: select json_build_object('somekey', 1.0, 'someotherkey', 2.0)::jsonb || json_build_object('thirdkey', 3.0)::jsonb; ?column? ──────────────────────────────────────────────────────── {"somekey": 1.0, "thirdkey": 3.0, "someotherkey": 2.0} (1 fila) -- Álvaro Herrera 39°49'30"S 73°17'W