public inbox for [email protected]
help / color / mirror / Atom feedFrom: Kirill Reshke <[email protected]>
To: jian he <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: Paul A Jungwirth <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Subject: Re: DELETE/UPDATE FOR PORTION OF with rule system is not working
Date: Mon, 13 Apr 2026 20:10:17 +0500
Message-ID: <CALdSSPianurospT5damYm2W30=3QbT1U45fau3HHDcn8Tb2LxA@mail.gmail.com> (raw)
In-Reply-To: <CACJufxGjgdWnhq5X5VL9orLXyKx-ZayT_Zj_-bAKr=kf0pZ_Nw@mail.gmail.com>
References: <CACJufxHs1Hs00EqsZ4NbuAjmYzMzjJyP1sAj12Ne=cBsEVmQOA@mail.gmail.com>
<CALdSSPiRHCyC0fYy_E=gO+c7sbwU=7=Fz2CF-4aEa3mAe7yYAg@mail.gmail.com>
<CACJufxGjgdWnhq5X5VL9orLXyKx-ZayT_Zj_-bAKr=kf0pZ_Nw@mail.gmail.com>
On Mon, 13 Apr 2026 at 14:01, jian he <[email protected]> wrote:
>
> hi.
> Actually it's supported.
>
> The issue mentioned in the first email is caused by:
> https://git.postgresql.org/cgit/postgresql.git/commit/?id=8e72d914c52876525a90b28444453de8085c866f
> https://git.postgresql.org/cgit/postgresql.git/diff/src/backend/nodes/nodeFuncs.c?id=8e72d914c528765...
>
> --- a/src/backend/nodes/nodeFuncs.c
> +++ b/src/backend/nodes/nodeFuncs.c
> @@ -2579,6 +2579,20 @@ expression_tree_walker_impl(Node *node,
> return true;
> }
> break;
> + case T_ForPortionOfExpr:
> + {
> + ForPortionOfExpr *forPortionOf = (ForPortionOfExpr *) node;
> +
> + if (WALK(forPortionOf->targetFrom))
> + return true;
> + if (WALK(forPortionOf->targetTo))
> + return true;
> + if (WALK(forPortionOf->targetRange))
> + return true;
> + if (WALK(forPortionOf->overlapsExpr))
> + return true;
> + }
> + break;
>
> We forgot to WALK (expression_tree_walker_impl)
> ForPortionOfExpr->rangeVar and ForPortionOfExpr->rangeTargetList.
> We need to WALK those two fields of ForPortionOfExpr in
> rewriteRuleAction (ChangeVarNodes,
> ReplaceVarsFromTargetList, etc.), and maybe elsewhere.
>
> i am surprised that nothing else has broken because of this.
>
>
>
> --
> jian
> https://www.enterprisedb.com/
This fix looks valid for me.
Also, are all 4 new test cases really needed? If yes, why are we
missing ON DELETE TO ... DO INSTEAD INSERT ?
--
Best regards,
Kirill Reshke
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: DELETE/UPDATE FOR PORTION OF with rule system is not working
In-Reply-To: <CALdSSPianurospT5damYm2W30=3QbT1U45fau3HHDcn8Tb2LxA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox