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-08 13:47:52
Message-ID: CAApHDvo_ks_p0OBo1=hPguA90niD=Zv5jLyx_A1N1mUPJZkabA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Please keep the list CC'd

On Thu, 8 Jul 2021 at 19:55, 小林優悦郎 <inconvenience(dot)notice(at)gmail(dot)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 that causes 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2021-07-08 14:36:19 Re: BUG #17094: FailedAssertion at planner.c
Previous Message Andrey Lepikhov 2021-07-08 10:32:38 Re: The case when AsyncAppend exists also in the qual of Async ForeignScan