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 1k2hd7-0006lW-8b for pgsql-docs@arkaria.postgresql.org; Mon, 03 Aug 2020 21:04:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k2hd6-0002YP-3m for pgsql-docs@arkaria.postgresql.org; Mon, 03 Aug 2020 21:04: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 1k2hd5-0002YH-Uc for pgsql-docs@lists.postgresql.org; Mon, 03 Aug 2020 21:04:19 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2hd3-0006Fj-Ow for pgsql-docs@postgresql.org; Mon, 03 Aug 2020 21:04:18 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1k2hcz-00042x-RH; Mon, 03 Aug 2020 17:04:13 -0400 Date: Mon, 3 Aug 2020 17:04:13 -0400 From: Bruce Momjian To: Joe Conway Cc: "Andrey M. Borodin" , Anna Akenteva , pgsql-docs@postgresql.org Subject: Re: [DOCS] Let's document a bytea bug Message-ID: <20200803210413.GE17519@momjian.us> References: <30380A0E-0188-4935-92B1-1F475C62C254@yandex-team.ru> <20200803202042.GC17519@momjian.us> <8ba460ba-9947-73e0-6920-a8a2bca436b9@joeconway.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ba460ba-9947-73e0-6920-a8a2bca436b9@joeconway.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Aug 3, 2020 at 04:44:38PM -0400, Joe Conway wrote: > It is easier to reproduce than that: > > select repeat('x',600000000)::bytea; > ERROR: invalid memory alloc request size 1200000003 > > select octet_length(repeat('x',600000000)::bytea); > octet_length > -------------- > 600000000 > (1 row) > > CREATE TABLE big_data AS > select repeat('x',600000000)::bytea; > SELECT 1 Oh, nice! I played with repeat(), but couldn't get it to load, then fail. I didn't do the cast to bytea, which is the trick. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee