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

From David Rowley
Subject Re: BUG #17089: "ERROR: invalid memory alloc request size ..." occurs when updating a fixed number of records
Date
Msg-id CAApHDvo7C39G7AU=e2_jDRBzO7qLti1q2MDuq1TW7v6X0ZdPOw@mail.gmail.com
Whole thread Raw
In response to BUG #17089: "ERROR: invalid memory alloc request size ..." occurs when updating a fixed number of records  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Wed, 7 Jul 2021 at 21:22, PG Bug reporting form
<noreply@postgresql.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



pgsql-bugs by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: BUG #16631: postgres_fdw tries to insert into generated columns
Next
From: Michael Paquier
Date:
Subject: Re: BUG #17088: FailedAssertion in prepagg.c