Re: BUG #17089: "ERROR: invalid memory alloc request size ..." occurs when updating a fixed number of records

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: inconvenience(dot)notice(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17089: "ERROR: invalid memory alloc request size ..." occurs when updating a fixed number of records
Date: 2021-07-07 10:16:30
Message-ID: CAApHDvo7C39G7AU=e2_jDRBzO7qLti1q2MDuq1TW7v6X0ZdPOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 7 Jul 2021 at 21:22, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> After importing a CSV file that exceeds 150GB in total into the table,
> "ERROR: invalid memory alloc request size 1677721600" always occurs in the
> UPDATE of 77658539 records.

You'd get a message like that if a varlena field was to exceed
MaxAllocSize (1GB).

Here's a simple example:

create table a (a text);
insert into a values(repeat('a',600*1024*1024));
update a set a = a || a;
ERROR: invalid memory alloc request size 1258291204

You can confirm if that's the case for you if you can narrow it down
to a single record causing the issue then check if the update would
cause a column in the table to exceed 1GB.

David

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2021-07-07 11:00:17 Re: BUG #17088: FailedAssertion in prepagg.c
Previous Message Etsuro Fujita 2021-07-07 09:35:09 Re: BUG #16631: postgres_fdw tries to insert into generated columns