Re: SQL/JSON revisited
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Amit Langote <amitlangote09@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Andres Freund <andres@anarazel.de>, vignesh C <vignesh21@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, e.indrupskaya@postgrespro.ru
Date: 2023-03-22T12:18:46Z
Lists: pgsql-hackers
Attachments
- v11-0001-SQL-JSON-constructors.patch (text/x-diff)
On 2023-Mar-16, Andrew Dunstan wrote: > Hi, I have taken these and done some surgery to reduce the explosion on > grammar symbols. The attached set is just Amit's patches with some of this > surgery done - nothing other than gram.y has been touched. Patches 2 and 5 > in the series could be sanely squashed onto patches 1 and 4 respectively. I > haven't done anything significant yet with the JSONTABLE patch, there is > probably some more low hanging fruit there, and possibly some still in the > earlier patches. Hello, It looks as if the grammar for this was originally written following the SQL standard's description to the letter. AFAICS reducing the number of nonterminals as you have done is a good thing. So I started from that point (0001+0002) to see what else is missing to make that independently committable. One thing I noticed is that a number of grammar hacks are not necessary until the IS JSON patch, so I've removed them from 0001 (the constructors patch) in order to make things easier to comprehend. We can put them back together with IS JSON. For the time being, 0001 is already large enough. So here's v11 of this (0001+0002 plus some changes of my own). At this point, the main thing I'm unhappy about is the fact that the documentation addition puts the new contents at the end of the chapter, which makes no sense. So we now have: 9.16.1. Processing and Creating JSON Data 9.16.2. The SQL/JSON Path Language 9.16.3. SQL/JSON Functions and Expressions where the standard functions are in 9.16.3 and describe functions that are for creating JSON data, so they should naturally be in 9.16.1. I'll see about reformulating the whole chapter so that it makes sense. I added an ECPG test file, to make sure that the weird grammar productions parse correctly. There are other minor things too, which I'll see about. Once I get this one done, I'll rebase and repost the rest of the series. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"
Commits
-
Add SQL/JSON query functions
- 6185c9737cf4 17.0 landed
-
Add soft error handling to some expression nodes
- aaaf9449ec6b 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
-
Code review for recent SQL/JSON commits
- 71bfd1543f8b 16.0 landed
-
Fix inconsistencies and style issues in new SQL/JSON code
- 60966f56c3e4 16.0 landed
-
Don't install postmaster symlink anymore
- 37e267335068 16.0 cited
-
Revert SQL/JSON features
- 2f2b18bd3f55 16.0 cited
-
Doc: standardize markup a bit more.
- 47046763c3ed 13.0 cited