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