Re: [BUG] Excessive memory usage with update on STORED generated columns. - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: [BUG] Excessive memory usage with update on STORED generated columns.
Date
Msg-id CAEze2WhsfFwfjooci5gqpSvq_1ibJHnJZ29c58GbDJWH9nbYkA@mail.gmail.com
Whole thread
In response to Re: [BUG] Excessive memory usage with update on STORED generated columns.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 30 Mar 2026 at 20:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> So I think the correct fix is that there needs to be a separate
> boolean tracking whether this work has been done, akin to
> ExecGetExtraUpdatedCols's use of ri_extraUpdatedCols_valid.

Why would it need a new boolean? ri_extraUpdatedCols_valid tracks
exactly whether we've already gone through ExecInitGenerated(...,
CMD_UPDATE), and in doing so if both ri_extraUpdatedCols,
ri_GeneratedExprsU, and ri_NumGeneratedNeededU are valid or whether
they still need to be populated. Adding a new boolean would therefore
be rather duplicative.

See also the patch of a few hours ago at [0].

Kind regards,

Matthias van de Meent
Databricks (https://www.databricks.com)


[0] https://postgr.es/m/CAEze2Wh%2B_C8LtmiMRb58df%3DA1PrBVmMnYMOfbBUk9c%3Dm99CN%2Bw%40mail.gmail.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUG] Excessive memory usage with update on STORED generated columns.
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] Add support for INSERT ... SET syntax