Re: [Patch]Add Graph* node support to expression_tree_mutator

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Patch]Add Graph* node support to expression_tree_mutator
Date: 2026-04-28 15:05:11
Message-ID: CAExHW5vm8MA_w975hP==OkGhbX2uciinUjRp_Pk310fN5uGW8w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 23, 2026 at 12:18 PM Ashutosh Bapat
<ashutosh(dot)bapat(dot)oss(at)gmail(dot)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 Content-Type Size
v20260428-0001-Handle-nodes-that-may-appear-in-GraphPatte.patch text/x-patch 6.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maksim Logvinenko 2026-04-28 15:13:11 Fix the error hint message and test for reset_shared with unknown stats type
Previous Message Ashutosh Bapat 2026-04-28 15:02:44 Re: [Bug][patch]: After dropping the last label from a property graph element, invoking pg_get_propgraphdef() triggers an assertion failure