Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT
Date: 2025-12-02 15:03:47
Message-ID: CACJufxEDN24yBCkFw9sgv2Ocoq=TAtydcJ1ZLR3PEb_NJnTfqA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 19, 2025 at 1:01 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> jian he <jian(dot)universality(at)gmail(dot)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 Content-Type Size
v2-0001-IS-JSON-predicate-work-with-domain-type.patch text/x-patch 22.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Srinath Reddy Sadipiralla 2025-12-02 15:03:09 Re: foreign key on virtual generated column