Re: [Patch]Add Graph* node support to expression_tree_mutator - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [Patch]Add Graph* node support to expression_tree_mutator
Date
Msg-id CAExHW5vm8MA_w975hP==OkGhbX2uciinUjRp_Pk310fN5uGW8w@mail.gmail.com
Whole thread
In response to Re: [Patch]Add Graph* node support to expression_tree_mutator  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: [Patch]Add Graph* node support to expression_tree_mutator
List pgsql-hackers
On Thu, Apr 23, 2026 at 12:18 PM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
>
>
> Why is MUTATE not called on GraphElementPattern::labelexpr and
> GraphElementPattern::quantifier?

The walker didn't WALK labelexpr and quantifier either. Given that
labelexpr is a boolean expression it needs to be WALKed. quantifier is
IntList which is ignored by other nodes as well when WALKing. But we
need to copy quantifier in mutator otherwise the mutated expression
will point to the same IntList as the original node. Other nodes also
copy the OidLists and IntLists when mutating them. I have modified the
test query to cover the label expression mutator.

raw_expression_walker didn't cover labelexpr either. Added it there.
The label expression at that stage contains ColumnRef and BoolExpr
which are already covered by raw expression tree walker.

--
Best Wishes,
Ashutosh Bapat

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [Bug][patch]: After dropping the last label from a property graph element, invoking pg_get_propgraphdef() triggers an assertion failure
Next
From: Bertrand Drouvot
Date:
Subject: Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE