public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dmitry Dolgov <[email protected]>
To: Haibo Yan <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Andy Fan <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Amit Langote <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: jian he <[email protected]>
Cc: Chapman Flack <[email protected]>
Cc: [email protected]
Subject: Re: Extract numeric filed in JSONB more effectively
Date: Mon, 6 Apr 2026 15:05:37 +0200
Message-ID: <l6mh4jmhbmdxgoqbpcjuxa5x27age7h5xtrqzpe5sjg7sjmrsa@4g7wv4zw5o5i> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<CAApHDvqnUONCN54dAXdH678ELK7aH2gyVhh0GjTRtrexPd9YMw@mail.gmail.com>
	<[email protected]>
	<mmilfltxeqgajpi4zok2v2moudot6bhdmwsqgjgnymz3nvkvng@k3caignaldcp>
	<[email protected]>
	<cudr6wao4hz2otlycx2z2equkigbjxslxvzqb3ejfc4amroheo@frqbvffcgqnu>
	<[email protected]>
	<CAApHDvozyjc8Qety7_aWeLaiNWGs59vBSoDNrNzXGgXbjL85NQ@mail.gmail.com>
	<[email protected]>

> On Fri, Apr 03, 2026 at 09:42:20AM -0700, Haibo Yan wrote:

Thanks for picking it up, the patch looks good.

> One small thing: the UI looks a bit odd on my side. It does not seem to have picked my attachment, and is instead showing your older attachment there. But cfbot appears to have picked up mine, so I think it may just be a UI issue.

It takes some time, as far as I can see currently the correct patch is shown.

> +		/*
> +		 * Identify the inner extraction expression.  It may appear as
> +		 * either a FuncExpr or an OpExpr; accept both forms.
> +		 */
> +		if (IsA(arg, FuncExpr))
> +		{
> +			FuncExpr   *inner = (FuncExpr *) arg;
> +
> +			inner_funcid = inner->funcid;
> +			inner_args = inner->args;
> +			location = inner->location;
> +		}
> +		else if (IsA(arg, OpExpr))
> +		{
> +			OpExpr	   *inner = (OpExpr *) arg;
> +
> +			inner_funcid = inner->opfuncid;
> +			inner_args = inner->args;
> +			location = inner->location;
> +		}
> +		else
> +			PG_RETURN_POINTER(NULL);

It may also appear as a SubscriptingRef expression if we use subscription over
jsonb.

	SELECT test_json['field7']::bool FROM test_jsonb WHERE json_type = 'object';

Seems to be worth handling this case as well, since it doesn't lead to an
interface explosion.





view thread (28+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Extract numeric filed in JSONB more effectively
  In-Reply-To: <l6mh4jmhbmdxgoqbpcjuxa5x27age7h5xtrqzpe5sjg7sjmrsa@4g7wv4zw5o5i>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox