Re: transformJsonFuncExpr pathspec cache lookup failed - Mailing list pgsql-hackers

From jian he
Subject Re: transformJsonFuncExpr pathspec cache lookup failed
Date
Msg-id CACJufxFtemjJbGNj=vp5Cupz8RSeb8VhgxzaDX049mrzNeDerQ@mail.gmail.com
Whole thread Raw
In response to Re: transformJsonFuncExpr pathspec cache lookup failed  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
On Wed, Nov 26, 2025 at 3:32 PM Amit Langote <amitlangote09@gmail.com> wrote:
>
> > > First,
> > > in the `src/backend/parser/parse_expr.c` fil there are multiple
> > > examples of working with `coerce_to_target_type`, they all share
> > > different coding practice:
> > >
> > > ```
> > > coerced_expr = coerce_to_target_type(.., expr, ..)
> > >
> > > if (coerced_expr == NULL)
> > >      ereport();
> > >
> > >
> > > expr = coerced_expr;
> > > ```
> > >
> > > Instead of
> > > ```
> > > expr = coerce_to_target_type(.., expr, ..)
> > >
> > > if (expr == NULL)
> > >      ereport();
> > > ```
> > >
> > > Let's be consistent?
> > >
> >
> > IMHO,
> > > coerced_expr = coerce_to_target_type(.., expr, ..)
> > is better than
> > > expr = coerce_to_target_type(.., expr, ..)
> >
> > I changed accordingly.
>
> I agree, though I prefer a different name for that coerced_* variable.
> Also, let’s define the _type and _loc variables inside the error
> block.  Updated patch attached.
>

v2-0001 looks good to me.


--
jian
https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: KAZAR Ayoub
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Next
From: Richard Guo
Date:
Subject: Re: Some optimizations for COALESCE expressions during constant folding