Re: Server crash when describing a FETCH statement after its cursor is closed

From: Dirkjan Bussink <d(dot)bussink(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Server crash when describing a FETCH statement after its cursor is closed
Date: 2026-09-25 18:27:56
Message-ID: AEE53B19-A4F4-4A77-A73E-053300E715DD@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> On 25 Sep 2026, at 16:33, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> The attached patch replaces the Assert with a runtime check returning
>> NIL, mirroring the guard in UtilityTupleDescriptor(). A regression
>> test is included.
>
> I'm not convinced by this blithe assertion "not our business to raise
> error". The adjacent case for ExecuteStmt *will* raise an error if
> it can't find the prepared statement; why shouldn't this case act like
> that one? IOW, the sequence of client operations that you show is
> invalid, and I think we ought to push back on that accordingly.

Also happy to change this to return an error then if that is preferred?

Crashing seems very wrong, but an error seems fine?
I can change the patch then to do that.

Cheers,

Dirkjan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-09-25 18:37:30 Re: Cleaning up pgcrypto/crypt-des.c to avoid compiler warnings
Previous Message shihao zhong 2026-09-25 18:10:09 Re: REPACK (CONCURRENTLY) can silently lose updates when the toast table is rewritten