Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT - Mailing list pgsql-hackers

From jian he
Subject Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT
Date
Msg-id CACJufxEDN24yBCkFw9sgv2Ocoq=TAtydcJ1ZLR3PEb_NJnTfqA@mail.gmail.com
Whole thread Raw
In response to Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Nov 19, 2025 at 1:01 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> jian he <jian.universality@gmail.com> writes:
> > [ v1-0001-IS-JSON-predicate-work-with-domain-type.patch ]
>
> This looks like a large patch with a small patch struggling to
> get out of it.  Why didn't you simply do
>
> -       *exprtype = exprType(expr);
> +       *exprtype = getBaseType(exprType(expr));
>
> in transformJsonParseArg?
>

yech.
While at it, I added parser_errposition to the transformJsonIsPredicate ereport.

errmsg("cannot use type %s in IS JSON predicate",
            format_type_be(exprtype))
we don't need to worry about exprtype as InvalidOid, because
transformJsonParseArg (exprType(expr)) would fail already in that case.


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

Attachment

pgsql-hackers by date:

Previous
From: Srinath Reddy Sadipiralla
Date:
Subject: Re: foreign key on virtual generated column
Next
From: Dilip Kumar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication