Re: [DOCS] Let's document a bytea bug

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Anna Akenteva <a(dot)akenteva(at)postgrespro(dot)ru>, pgsql-docs(at)postgresql(dot)org
Subject: Re: [DOCS] Let's document a bytea bug
Date: 2020-08-03 21:04:13
Message-ID: 20200803210413.GE17519@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

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

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2020-08-03 21:21:35 Re: 7 decimal digits precision for real
Previous Message Joe Conway 2020-08-03 20:44:38 Re: [DOCS] Let's document a bytea bug