Re: JSON Path and GIN Questions
David E. Wheeler <david@justatheory.com>
From: "David E. Wheeler" <david@justatheory.com>
To: Erik Wienhold <ewie@ewie.name>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2023-09-16T20:26:07Z
Lists: pgsql-hackers
On Sep 12, 2023, at 21:00, Erik Wienhold <ewie@ewie.name> wrote: >> If so, I’d like to submit a patch to the docs talking about this, and >> suggesting the use of jsonb_path_query() to test paths to see if they return >> a boolean or not. > > +1 I’ve started work on this; there’s so much to learn! Here’s a new example that surprised me a bit. Using the GPS tracker example from the docs [1] loaded into a `:json` psql variable, this output of this query makes perfect sense to me: david=# select jsonb_path_query(:'json', '$.track.segments.location[*] ? (@ < 14)'); jsonb_path_query ------------------ 13.4034 13.2635 Because `[*]` selects all the values. This, however, I did not expect: david=# select jsonb_path_query(:'json', '$.track.segments.location ? (@[*] < 14)'); jsonb_path_query ------------------ 13.4034 13.2635 (2 rows) I had expected it to return two single-value arrays, instead: [13.4034] [13.2635] It appears that the filter expression is doing some sub-selection, too. Is that expected? Best, David [1]: https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-SQLJSON-PATH
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: add a bit to indices.sgml about what is an indexable clause.
- b7412e293b6b 17.0 landed
- b4c147ac6fd5 13.14 landed
- afc987e19610 15.6 landed
- 8b9d39254816 16.2 landed
- 7a4bdd986ab9 14.11 landed
- 499342e81b0f 12.18 landed