pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Joe Conway <mail@joeconway.com>
Cc: Andrey M. Borodin <x4mmm@yandex-team.ru>
Cc: Anna Akenteva <a.akenteva@postgrespro.ru>
Cc: pgsql-docs@postgresql.org
Subject: Re: [DOCS] Let's document a bytea bug
Date: Mon, 3 Aug 2020 17:04:13 -0400
Message-ID: <20200803210413.GE17519@momjian.us> (raw)
In-Reply-To: <8ba460ba-9947-73e0-6920-a8a2bca436b9@joeconway.com>
References: <fe9b3722df94f7bdb08768f50ee8fe59@postgrespro.ru>
	<30380A0E-0188-4935-92B1-1F475C62C254@yandex-team.ru>
	<20200803202042.GC17519@momjian.us>
	<8ba460ba-9947-73e0-6920-a8a2bca436b9@joeconway.com>

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  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






view thread (5+ messages)  latest in thread

Message-ID: <20200803210413.GE17519@momjian.us>
Permalink:  ../20200803210413.GE17519@momjian.us/
Also on:    postgresql.org/message-id/20200803210413.GE17519@momjian.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, mail@joeconway.com, x4mmm@yandex-team.ru, a.akenteva@postgrespro.ru
  Subject: Re: [DOCS] Let's document a bytea bug
  In-Reply-To: <20200803210413.GE17519@momjian.us>

* 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