Re: Extract numeric filed in JSONB more effectively
Chapman Flack <chap@anastigmatix.net>
From: Chapman Flack <chap@anastigmatix.net>
To: Andy Fan <zhihui.fan1213@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, jian he
<jian.universality@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-08-03T12:34:44Z
Lists: pgsql-hackers
On 2023-08-03 03:53, Andy Fan wrote: > I didn't realize timetime types are binary compatible with SQL, > so maybe we can have some similar optimization as well. > (It is a pity that timestamp(tz) are not binary, or else we may > just need one operator). Not to veer from the thread, but something about that paragraph has been hard for me to parse/follow. >> Maybe we can introduce some *internal operator* "extract to type", and >> in >> rewrite stage we can the pattern (x->'field')::type transform to OP(x, >> 'field', typid) > > Not sure what the OP should be? If it is a function, what is the > return value? It looks to me like it is hard to do in c language? Now I am wondering about the 'planner support function' available in CREATE FUNCTION since PG 12. I've never played with that yet. Would that make it possible to have some, rather generic, extract from JSON operator that can look at the surrounding expression and replace itself sometimes with something more efficient? Regards, -Chap
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add trailing commas to enum definitions
- 611806cd726f 17.0 cited