3 ms·
Sort of. The syntax is different, but close. SQL 2023: SELECT a.key PostgreSQL 9.3: SELECT a->'key' PostgreSQL 14: SELECT a['key']
by paulddraper 4y ago
Sort of.
The syntax is different, but close.
SQL 2023: SELECT a.key
PostgreSQL 9.3: SELECT a->'key'
PostgreSQL 14: SELECT a['key']
- Shorn 4y agoI've always disliked the postgres JSON syntax. Don't get me wrong - I love the feature and use it a lot, but I find the syntax awkward and honestly just... strange (though I've not researched it and have no idea of the reasoning behind it). Will postgres adopt the SQL standard for JSON "simplified accessor" syntax? Has there been any statements or communications from the development team?
- masklinn 4y ago> Don't get me wrong - I love the feature and use it a lot, but I find the syntax awkward and honestly just... strange (though I've not researched it and have no idea of the reasoning behind it). I'm pretty sure the syntax was just reused from hstore (https://www.postgresql.org/docs/current/hstore.html https://www.postgresql.org/docs/current/hstore.html), for familiarity and simplicity. hstore predates json by 4-5 years. It might also have made expressions easier to parse, as it doesn't conflict with normal identifier access.