On Tue, 5 Nov 2024 at 16:17, Peter Eisentraut <pe...@eisentraut.org> wrote: > > New patch version.
In expand_generated_columns_in_expr(): + /* + * XXX For the benefit of triggers, make two passes, so it covers + * PRS2_OLD_VARNO and PRS2_NEW_VARNO. + */ + node = expand_generated_columns_internal(node, rel, 1, rte); + node = expand_generated_columns_internal(node, rel, 2, rte); It seems a bit messy to be doing these two passes in expand_generated_columns_in_expr(), when it is only needed for triggers. I think it was better the way it was in the v7 patch, passing rt_index to expand_generated_columns_in_expr(), so that TriggerEnabled() did this: + tgqual = (Node *) expand_generated_columns_in_expr(tgqual, relinfo->ri_RelationDesc, PRS2_OLD_VARNO); + tgqual = (Node *) expand_generated_columns_in_expr(tgqual, relinfo->ri_RelationDesc, PRS2_NEW_VARNO); Regards, Dean