Re: [PG19] plpgsql: SELECT INTO sets FOUND wrongly after a function becomes a SRF

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PG19] plpgsql: SELECT INTO sets FOUND wrongly after a function becomes a SRF
Date: 2026-10-05 22:35:58
Message-ID: 1337576.1791239758@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

shihao zhong <zhong950419(at)gmail(dot)com> writes:
> I used Opus to analyze the new features in PG19, and it found a problem
> with the "SELECT simple-expression INTO var" fast path from ce8d5fe0e28.

Good catch, and I concur with your fix. While looking at it
I also realized that the bit with

if (expr->plan == NULL)
exec_prepare_plan(estate, expr, 0);

is quite useless: we dealt with expr->plan == NULL a few lines
earlier, so this if-test can never succeed. Pushed with that
change.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mihail Nikalayeu 2026-10-05 22:36:00 Re: [BUG?] check_exclusion_or_unique_constraint false negative
Previous Message Mihail Nikalayeu 2026-10-05 22:35:00 Re: Logical replication: lost updates/deletes and invalid log messages caused by SnapshotDirty + concurrent updates