Re: Virtual generated columns - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Virtual generated columns
Date
Msg-id a41f2853-ebb5-4d7d-9e4a-eccafec7470d@eisentraut.org
Whole thread Raw
In response to Re: Virtual generated columns  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On 07.11.24 11:02, Dean Rasheed wrote:
> On Tue, 5 Nov 2024 at 16:17, Peter Eisentraut <peter@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);

Yeah, I put it back that way in v9.




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: doc: pgevent.dll location
Next
From: Peter Eisentraut
Date:
Subject: Re: Virtual generated columns