Re: Extract numeric filed in JSONB more effectively - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Extract numeric filed in JSONB more effectively
Date
Msg-id CAFj8pRAfBYLbaVHvcFwHeDy2zakKCb=jtWde5AXgMRL3pw0iMg@mail.gmail.com
Whole thread Raw
In response to Re: Extract numeric filed in JSONB more effectively  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers


po 14. 8. 2023 v 11:17 odesílatel Andy Fan <zhihui.fan1213@gmail.com> napsal:

you cannot to use type as parameter. There should be some typed value - like

jsonb_object_field, '{"a":10}', 'a', NULL::int)

and return type should be anyelement.


So could we get the inputted type in the body of jsonb_object_field? 
I guess no.  IIUC, our goal will still be missed in this way. 

why not? You can easily build null constant of any type. 

--
Best Regards
Andy Fan

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: jsonb_populate_array
Next
From: Tomas Vondra
Date:
Subject: Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500