Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBWBs-0001Am-Rp for pgsql-docs@arkaria.postgresql.org; Thu, 26 Apr 2018 01:59:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBWBr-0000xn-0E for pgsql-docs@arkaria.postgresql.org; Thu, 26 Apr 2018 01:59:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBWBq-0000xe-Mu for pgsql-docs@lists.postgresql.org; Thu, 26 Apr 2018 01:59:18 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBWBo-0003op-2I for pgsql-docs@lists.postgresql.org; Thu, 26 Apr 2018 01:59:17 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 298A221B74; Wed, 25 Apr 2018 21:59:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 25 Apr 2018 21:59:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ulxUJE1C6mQJ2voiFgs1cRWWfk4LkmHLz6qPjlgkm/A=; b=MGAqWABC szwvHCoHzueeX66rN5Mj8wmBYjut8hOhAw8p6TRypgneEDOHyQYnEhCDv5kfNfh1 VfHh0Vdj/nEXCEKuHUCoxdzATsrun6BafqSKZ1xBuRiclZRpewxiKd0tqHP0Vmxs 1Izq5SqX1856NQcw6TZ5vi44aE3Cm5DQzPRPCyvMRHh1wu6shX7BZhxourxOjy+C hxZIAOYV8uAkTNTiRb/E2mr4iphxkKnsMKasU22YQ8Edb/lfV0jtACkw/hVoKJs2 T9O1Iyk1p/Hxszc5RwgOS1dfVixV/OzY1JtXqG9XT5A8E7euatdGGdBSjGBr3F8Q PPS12EfdASLlvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=ulxUJE1C6mQJ2voiFgs1cRWWfk4Lk mHLz6qPjlgkm/A=; b=YzTtrt/U6pDlxPZ45l6FaiU4JlsJW0gQ8VaUdr00Lg1oK TAOTrXeB22d34AXXGTXtrPboBzMgwOEkM/L3zJYkSNGAUTHk5L6rBfJ5uqG8O56I gobSmYmg8/wcseG/GLG33rzIV/s3prCzm4F1h5gbsml96RZaMAVQqmGWBaOPFSkT v7W7NAuV3IMFm+i7BwpW8puWFpzlKoQESnzzM7m18rTxq2sjH/Q/+6hSUB+v1Ip6 +ids75CI3HHgM/DK+4kSKq6VLpioHpuAzA3JbERAbOHD6UdnSI9oAxSgvreyHx9x o82OxVqULHP3aqxnCOEa1+Phko24rbsHCADb8/V+A== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D474E4B94; Wed, 25 Apr 2018 21:59:13 -0400 (EDT) Date: Thu, 26 Apr 2018 10:59:10 +0900 From: Michael Paquier To: Oleg Bartunov Cc: Tom Lane , pgsql-docs@lists.postgresql.org Subject: Re: document json[b] limitation Message-ID: <20180426015910.GC18940@paquier.xyz> References: <17093.1524611576@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eqp4TxRxnD4KrmFZ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --eqp4TxRxnD4KrmFZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 25, 2018 at 06:50:51PM +0300, Oleg Bartunov wrote: > Oops, it should be 256 Mb :) The numbers you are presenting are right, aka 1GB for json: =# create table aa (a json); CREATE TABLE =# insert into aa select ('{"key":"' || repeat('a', 512 * 1024 * 1024) || repeat('a', 500 * 1024 * 1024) || '"}')::json; INSERT 0 1 =# insert into aa select ('{"key":"' || repeat('a', 512 * 1024 * 1024) || repeat('a', 512 * 1024 * 1024) || '"}')::json; ERROR: XX000: invalid memory alloc request size 1073741836 LOCATION: palloc, mcxt.c:934 And 256MB for jsonb: =# create table ab (a jsonb); CREATE TABLE =# insert into aa select ('{"key":"' || repeat('a', 256 * 1024 * 1024) || '"}')::jsonb; ERROR: 54000: string too long to represent as jsonb string DETAIL: Due to an implementation restriction, jsonb strings cannot exceed 268435455 bytes. Be sure to use an upper-case "B" to mean bytes and not bits in the documentation. -- Michael --eqp4TxRxnD4KrmFZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlrhMm4ACgkQnvQgOdby QH0bfA//e/9TDjla/Jd+VITvPs37i2XFTnXAKVGMdR063at5GpfZZ2PlxXvcc3Na 7HVi66nhDlhdiMEamJmQ2y2ySmB4ON0kG5ux5FbzpKlVZHYgCOmpV6xC34hpLIDy zYl3wCu/4etYZd/Zb0UFUDkyp2skd+pVY3ixzrixRte2ew8ItNjwslkAlBuztf06 FiXXdgZcnVzQyygcxl3e98lRTwGBFyGVStKAgfjj5926rs0ymlQW1V3qZHhI2lSs sPCxaAl9GqtDtnpkdkL28ImA5kmoxdK8ujVgJOYrlyVIcJCBRjSQrtmJ6NdL2wXn foXFKaG2Hi9j8qTQ7zAuzCC7KPev+dXfQV2n8Yl4p5aXCB8wOE6ZyeStxtBli9IH haz8jh40qnTdZCkaFd3Mtp3+ryoneYFfGrmnOXJoKxvU0FykKFxKUebbzM4AsCH/ swsy6X02Y4HNva+wDXUYwAmNtssugMEJCt01COQ6kSwsfOm2L9kUIErP0SWfALXS uXewsbgb2Lr0HsQcXqQeRTowgPITOWrwiLyM7IWF865LuA5MxqDxnCK8SC3Id6WA zy/vcocG9spJfTv4WENd6RxsTfajnAdwxUSfpSnbiOio/W/Fa0YaUnz1bOydnzqV PoRFWikvGGwJro/BdAIhZcMKyeFFgICQYgumDhzDI6mzIk1aRik= =53G5 -----END PGP SIGNATURE----- --eqp4TxRxnD4KrmFZ--