Re: remaining sql/json patches
Alvaro Herrera <alvherre@alvh.no-ip.org>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
SQL/JSON: Various improvements to SQL/JSON query function docs
- ce416fadb4b6 17.0 landed
- 42de72fa7b80 18.0 landed
-
SQL/JSON: Fix some obsolete comments.
- 290a6d800d90 17.0 landed
- 7768b6569de9 16.4 landed
- 3a8a1f3254b2 18.0 landed
-
SQL/JSON: Fix issues with DEFAULT .. ON ERROR / EMPTY
- c0fc0751862d 17.0 landed
-
JSON_TABLE: Add support for NESTED paths and columns
- bb766cde63b4 17.0 landed
-
Fix JsonExpr deparsing to emit QUOTES and WRAPPER correctly
- f6a2529920cf 17.0 landed
-
Fix typo introduced in 6185c9737
- 2f6e78b0619a 17.0 landed
-
Add basic JSON_TABLE() functionality
- de3600452b61 17.0 landed
-
Avoid splitting errmsg string to span multiple lines
- 085e759e9da7 17.0 landed
-
Add SQL/JSON query functions
- 6185c9737cf4 17.0 landed
-
Implement various jsonpath methods
- 66ea94e8e606 17.0 cited
-
Add soft error handling to some expression nodes
- aaaf9449ec6b 17.0 landed
- 7fbc75b26ed8 17.0 landed
-
Adjust populate_record_field() to handle errors softly
- 1edb3b491bee 17.0 landed
-
Refactor code used by jsonpath executor to fetch variables
- faa2b953ba3b 17.0 landed
-
Test EXPLAIN (FORMAT JSON) ... XMLTABLE
- 752533d40fd5 17.0 landed
-
Simplify productions for FORMAT JSON [ ENCODING name ]
- d3fe6e90bab5 17.0 landed
-
Add trailing commas to enum definitions
- 611806cd726f 17.0 cited
-
doc: add missing <returnvalue> and whitespace
- e055b6be7ebb 17.0 landed
-
Add more SQL/JSON constructor functions
- 03734a7fed7d 17.0 landed
-
Rename a nonterminal used in SQL/JSON grammar
- 254ac5a7c31f 17.0 landed
-
Some refactoring to export json(b) conversion functions
- b22391a2ff7b 17.0 landed
-
Don't include CaseTestExpr in JsonValueExpr.formatted_expr
- 66a9003e2e3e 16.0 landed
- b6e1157e7d33 17.0 landed
-
Code review for commit b6e1157e7d
- 7c7412cae3ea 17.0 landed
-
Pass constructName to transformJsonValueExpr()
- 7825a1b01e40 16.0 landed
- 785480c9533d 17.0 landed
-
Unify JSON categorize type API and export for external use
- 3c152a27b063 17.0 landed
-
Make some indentation in gram.y consistent
- 5edf438eeb00 17.0 landed
- 01f1f789df56 16.0 landed
-
Allow most keywords to be used as column labels without requiring AS.
- 06a7c3154f5b 14.0 cited
-
Reduce size of backend scanner's tables.
- 7f380c59f800 13.0 cited
-
Use perfect hashing, instead of binary search, for keyword lookup.
- c64d0cd5ce24 12.0 cited
On 2023-Jul-10, Amit Langote wrote: > > I see that you add json_returning_clause_opt, but we already have > > json_output_clause_opt. Shouldn't these two be one and the same? > > I think the new name is more sensible than the old one, since the > > governing keyword is RETURNING; I suppose naming it "output" comes from > > the fact that the standard calls this <JSON output clause>. > > One difference between the two is that json_output_clause_opt allows > specifying the FORMAT clause in addition to the RETURNING type name, > while json_returning_clause_op only allows specifying the type name. > > I'm inclined to keep only json_returning_clause_opt as you suggest and > make parse_expr.c output an error if the FORMAT clause is specified in > JSON() and JSON_SCALAR(), so turning the current syntax error on > specifying RETURNING ... FORMAT for these functions into a parsing > error. Done that way in the attached updated patch and also updated > the latter patch that adds JSON_EXISTS() and JSON_VALUE() to have > similar behavior. Yeah, that's reasonable. > > I'm not in love with the fact that JSON and JSONB have pretty much > > parallel type categorizing functionality. It seems entirely artificial. > > Maybe this didn't matter when these were contained inside each .c file > > and nobody else had to deal with that, but I think it's not good to make > > this an exported concept. Is it possible to do away with that? I mean, > > reduce both to a single categorization enum, and a single categorization > > API. Here you have to cast the enum value to int in order to make > > ExecInitExprRec work, and that seems a bit lame; moreso when the > > "is_jsonb" is determined separately (cf. ExecEvalJsonConstructor) > > OK, I agree that a unified categorizing API might be better. I'll > look at making this better. Btw, does src/include/common/jsonapi.h > look like an appropriate place for that? Hmm, that header is frontend-available, and the type-category appears to be backend-only, so maybe no. Perhaps jsonfuncs.h is more apropos? execExpr.c is already dealing with array internals, so having to deal with json internals doesn't seem completely out of place. > > In the 2023 standard, JSON_SCALAR is just > > > > <JSON scalar> ::= JSON_SCALAR <left paren> <value expression> <right paren> > > > > but we seem to have added a <JSON output format> clause to it. Should > > we really? > > Hmm, I am not seeing <JSON output format> in the rule for JSON_SCALAR, Agh, yeah, I confused myself, sorry. > Per what I wrote above, the grammar for JSON() and JSON_SCALAR() does > not allow specifying the FORMAT clause. Though considering what you > wrote, the RETURNING clause does appear to be an extension to the > standard's spec. Hmm, I see that <JSON output clause> (which is RETURNING plus optional FORMAT) appears included in JSON_OBJECT, JSON_ARRAY, JSON_QUERY, JSON_SERIALIZE, JSON_OBJECTAGG, JSON_ARRAYAGG. It's not necessarily a bad thing to have it in other places, but we should consider it carefully. Do we really want/need it in JSON() and JSON_SCALAR()? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/