Re: [PATCH] Add enable_copy_program GUC to control COPY PROGRAM

From: Michael Banck <mbanck(at)gmx(dot)net>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Ignat Remizov <ignat980(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add enable_copy_program GUC to control COPY PROGRAM
Date: 2025-12-05 07:32:58
Message-ID: 20251205073257.GG13635@p46.dedyn.io;lightning.p46.dedyn.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Dec 03, 2025 at 11:29:09PM +0500, Kirill Reshke wrote:
> On Wed, 3 Dec 2025 at 23:17, I wrote:
> > (I did derive the exact example
> > when postgresql immediately restarts after some SQL but im 100% there
> > is such thing )
>
> select repeat('a',1024*1024*1023) from generate_series(1, 100);

I get

out of memory for query result

I guess it depends on whether you have memory overcommit on or off,
and/or whether you run in a container/Kubernetes. Or maybe it depends on
something else.

This denial of service is a different problem, and I agree that Postgres
desperately needs a way to limit memory allocations per user (one can
set work_mem as high as 1.999TB as regular user) and globally.

Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2025-12-05 07:38:16 Re: [PATCH] Add enable_copy_program GUC to control COPY PROGRAM
Previous Message Masahiko Sawada 2025-12-05 07:13:37 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart