Re: remaining sql/json patches - Mailing list pgsql-hackers

From Amit Langote
Subject Re: remaining sql/json patches
Date
Msg-id CA+HiwqGGqJ=vjRr1Y_8KRc9ZtabaLwxEhEGHCRXnr1UTw1o-7Q@mail.gmail.com
Whole thread Raw
In response to Re: remaining sql/json patches  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-hackers
Hi Alexander,

On Fri, Jun 28, 2024 at 5:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
>
> Hi Amit,
>
> 28.06.2024 09:15, Amit Langote wrote:
> > Hi Alexander,
> >
> >
> > Thanks for the report.  Yeah, those comments that got added in
> > 7081ac46ace are obsolete.
> >
>
> Thanks for paying attention to that!
>
> Could you also look at comments for transformJsonObjectAgg() and
> transformJsonArrayAgg(), aren't they obsolete too?

You're right.  I didn't think they needed to be similarly fixed,
because I noticed the code like the following in in
transformJsonObjectAgg() which sets the OID of the function to call
from, again, JsonConstructorExpr:

    {
        if (agg->absent_on_null)
            if (agg->unique)
                aggfnoid = F_JSONB_OBJECT_AGG_UNIQUE_STRICT;
            else
                aggfnoid = F_JSONB_OBJECT_AGG_STRICT;
        else if (agg->unique)
            aggfnoid = F_JSONB_OBJECT_AGG_UNIQUE;
        else
            aggfnoid = F_JSONB_OBJECT_AGG;

        aggtype = JSONBOID;
    }

So, yes, the comments for them should be fixed too like the other two
to also mention JsonConstructorExpr.

Updated patch attached.

Wonder if Alvaro has any thoughts on this.

--
Thanks, Amit Langote

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: cfbot update: Using GitHub for patch review
Next
From: Alexander Lakhin
Date:
Subject: Re: Why is infinite_recurse test suddenly failing?