From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com> |
Subject: | Re: Virtual generated columns |
Date: | 2024-11-12 16:07:14 |
Message-ID: | a41f2853-ebb5-4d7d-9e4a-eccafec7470d@eisentraut.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 07.11.24 11:02, Dean Rasheed wrote:
> On Tue, 5 Nov 2024 at 16:17, Peter Eisentraut <peter(at)eisentraut(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2024-11-12 16:08:16 | Re: Virtual generated columns |
Previous Message | Peter Eisentraut | 2024-11-12 16:06:37 | Re: Virtual generated columns |