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 CAApHDvo_ks_p0OBo1=hPguA90niD=Zv5jLyx_A1N1mUPJZkabA@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>)
Responses Re: BUG #17089: "ERROR: invalid memory alloc request size ..." occurs when updating a fixed number of records  (Yuetsuro Kobayashi <inconvenience.notice@gmail.com>)
List pgsql-bugs
Please keep the list CC'd

On Thu, 8 Jul 2021 at 19:55, 小林優悦郎 <inconvenience.notice@gmail.com> wrote:
>
> I'm not understand David's answer.
> Why does the UPDATE process succeed when I import only a CSV file that contains the 776,558,539th record information
thatcauses an "ERROR: invalid memory alloc request size 167772160" and perform the UPDATE process? 
>     1st directory : xxx_1 (1 - 5,671,588 record)
>     2nd directory: xxx_2 (1 - 4,917,081 record)
>         ...
>     13th directory: xxx_13 ( 1 - ... ERROR by 3,211,154th record)

You should look at that record and see if any fields are unusually
larger than the others.   Types like text, bytea and arrays of types
all have a size limit of 1 Gigabyte in PostgreSQL (internally named
MaxAllocSize).   Going by your original post, in the error message
your receiving, it seems that something is asking for 1677721600
bytes, which is about 1.6GB. Since that's larger than the 1GB limit,
you're getting an error.

You need to look at your data and statements and figure out what might
attempt to store a field that size in the database.

David



pgsql-bugs by date:

Previous
From: Andrey Lepikhov
Date:
Subject: Re: The case when AsyncAppend exists also in the qual of Async ForeignScan
Next
From: Richard Guo
Date:
Subject: Re: BUG #17094: FailedAssertion at planner.c