Re: BUG #18484: "Cannot enlarge string buffer" during parallel execution of prepared statement/partitioning

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: michael(dot)banck(at)netapp(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18484: "Cannot enlarge string buffer" during parallel execution of prepared statement/partitioning
Date: 2024-05-30 01:26:20
Message-ID: CAApHDvo+sBc1836ktwVNesgPb7L9Bx1=p4OQpeieq8pg0nW-hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 29 May 2024 at 04:42, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> ERROR: out of memory
> DETAIL: Cannot enlarge string buffer containing 1073741812 bytes by 32 more
> bytes.

> I agree that the overall schema architecture should be rethought and much
> fewer partitions be used (and they are looking into this), but as the error
> does only happen with a parallel plan, I am reporting it here in case there
> is an easy fix for this, or at least maybe we can abort earlier with a
> better error message?

I think we should at least write a better error message. "out of
memory" is misleading. I've attached a patch with some proposed better
wording.

The above will become:
ERROR: string buffer exceeds maximum allowed length (1073741823)
DETAIL: Cannot enlarge string buffer containing 1073741812 bytes by 32 more

I also see a few other places that report
ERRCODE_PROGRAM_LIMIT_EXCEEDED and display "out of memory". Namely:

pg_do_encoding_conversion
perform_default_encoding_conversion
pvsnprintf

We should probably consider fixing those too.

I understand this isn't to the level that you'd like to see this
fixed, but it at least should stop people from thinking that
installing more RAM might help.

David

Attachment Content-Type Size
adjust_enlargeStringInfo_error_msg.patch application/octet-stream 894 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2024-05-30 06:25:00 Re: BUG #18484: "Cannot enlarge string buffer" during parallel execution of prepared statement/partitioning
Previous Message Marcin Barczyński 2024-05-29 13:32:21 Re: BUG #18334: Segfault when running a query with parallel workers