-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/5214~1
head repository: postgresql-cfbot/postgresql
compare: cf/5214
- 9 commits
- 27 files changed
- 3 contributors
Commits on Apr 29, 2025
-
Allow transformation of only a sublist of subscripts
This is a preparation step for allowing subscripting containers to transform only a prefix of an indirection list and modify the list in-place by removing the processed elements. Currently, all elements are consumed, and the list is set to NIL after transformation. In the following commit, subscripting containers will gain the flexibility to stop transformation when encountering an unsupported indirection and return the remaining indirections to the caller.
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 1de1549 - Browse repository at this point
Copy the full SHA 1de1549View commit details -
Allow Generic Type Subscripting to Accept Dot Notation (.) as Input
This change extends generic type subscripting to recognize dot notation (.) in addition to bracket notation ([]). While this does not yet provide full support for dot notation, it enables subscripting containers to process it in the future. For now, container-specific transform functions only handle subscripting indices and stop processing when encountering dot notation. It is up to individual containers to decide how to transform dot notation in subsequent updates.
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 10bf47d - Browse repository at this point
Copy the full SHA 10bf47dView commit details -
Export jsonPathFromParseResult()
This is a preparation step for a future commit that will reuse the aforementioned function.
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 0f51198 - Browse repository at this point
Copy the full SHA 0f51198View commit details -
Extract coerce_jsonpath_subscript()
This is a preparation step for a future commit that will reuse the aforementioned function.
Configuration menu - View commit details
-
Copy full SHA for 3c5017a - Browse repository at this point
Copy the full SHA 3c5017aView commit details -
Enable String node as field accessors in generic subscripting
Now that we are allowing container generic subscripting to take dot notation in the list of indirections, and it is transformed as a String node. For jsonb, we want to represent field accessors as String nodes in refupperexprs for distinguishing from ordinary text subscripts which can be needed for correct EXPLAIN. Strings node is no longer a valid expression nodes, so added special handling for them in walkers in nodeFuncs etc.
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 3f2d616 - Browse repository at this point
Copy the full SHA 3f2d616View commit details -
Implement read-only dot notation for jsonb
This patch introduces JSONB member access using dot notation, wildcard access, and array subscripting with slicing, aligning with the JSON simplified accessor specified in SQL:2023. Specifically, the following syntax enhancements are added: 1. Simple dot-notation access to JSONB object fields 2. Wildcard dot-notation access to JSONB object fields 2. Subscripting for index range access to JSONB array elements Examples: -- Setup create table t(x int, y jsonb); insert into t select 1, '{"a": 1, "b": 42}'::jsonb; insert into t select 1, '{"a": 2, "b": {"c": 42}}'::jsonb; insert into t select 1, '{"a": 3, "b": {"c": "42"}, "d":[11, 12]}'::jsonb; -- Existing syntax predates the SQL standard: select (t.y)->'b' from t; select (t.y)->'b'->'c' from t; select (t.y)->'d'->0 from t; -- JSON simplified accessor specified by the SQL standard: select (t.y).b from t; select (t.y).b.c from t; select (t.y).d[0] from t; The SQL standard states that simplified access is equivalent to: JSON_QUERY (VEP, 'lax $.JC' WITH CONDITIONAL ARRAY WRAPPER NULL ON EMPTY NULL ON ERROR) where: VEP = <value expression primary> JC = <JSON simplified accessor op chain> For example, the JSON_QUERY equivalents of the above queries are: select json_query(y, 'lax $.b' WITH CONDITIONAL ARRAY WRAPPER NULL ON EMPTY NULL ON ERROR) from t; select json_query(y, 'lax $.b.c' WITH CONDITIONAL ARRAY WRAPPER NULL ON EMPTY NULL ON ERROR) from t; select json_query(y, 'lax $.d[0]' WITH CONDITIONAL ARRAY WRAPPER NULL ON EMPTY NULL ON ERROR) from t; Implementation details: Extends the existing container subscripting interface to support container-specific information, specifically a JSONPath expression for jsonb. During query transformation, detects dot-notation, wildcard access, and sliced subscripting. If any of these accessors are present, constructs a JSONPath expression representing the access chain. During execution, if a JSONPath expression is present in JsonbSubWorkspace, executes it via JsonPathQuery(). Does not transform accessors directly into JSON_QUERY during transformation to preserve the original query structure for EXPLAIN and CREATE VIEW.
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 37faa41 - Browse repository at this point
Copy the full SHA 37faa41View commit details -
Allow wild card member access for jsonb
Nikita Glukhov authored and Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 4d9ecaa - Browse repository at this point
Copy the full SHA 4d9ecaaView commit details -
Add "**" as a new token in scanners
DOUBLE_ASTERISK is now recognized but not yet implemented. This change improves error message readability, as "**" is supported in jsonpath_scan.l as ANY_P. However, the SQL standard for simplified JSON accessors does not specify "**", so it is not supported in that context.
Configuration menu - View commit details
-
Copy full SHA for fb0d624 - Browse repository at this point
Copy the full SHA fb0d624View commit details -
[CF 5214] v11 - SQL:2023 JSON simplified accessor support
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5214 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAK98qZ1nz6ZZhQqTOCNwRguZE5GsBLW5BQT_k=s7AA6gc2CN_g@mail.gmail.com Author(s): Alexandra Wang
Commitfest Bot committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for e7f3fba - Browse repository at this point
Copy the full SHA e7f3fbaView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/5214~1...cf/5214