JSON support in SQL Standard, PostreSQL, and MySQL

2.8k Views Asked by At

I have been trying to gather some information regarding JSON support in SQL but Google doesn't help much. The more I search the more confused I become. Here are my simple questions:

  • Does the current or upcoming SQL standard define support for JSON storage and manipulation?
  • If the answer to the above is yes, where can I find a document (even a draft) that describes the SQL/JSON specification?
  • It appears that several databases (SQL Server, Oracle, PostreSQL, MySQL) support JSON but their functions/queries seem different in many cases: https://blogs.oracle.com/svetasmirnova/entry/mysql_and_postgresql_json_functions Which of these databases implement the SQL/JSON standard (current or draft, if there is one)?

Btw, I am mostly interested in PostreSQL and MySQL JSON support.

Thank you in advance.

3

There are 3 best solutions below

0
On BEST ANSWER

There is a draft standard for SQL/JSON but it is still not publicly available. It is mostly driven by Oracle so they are aligned with the standard. SQL Server is similar with some syntax/naming changes (e.g. instead of JSON_TABLE it uses OPENJSON syntax but functionality is similar). Oracle/MSSQL use JSON as text representation, PostgreSQL/MySQL have types. You can see overview of functions here:

http://ocelot.ca/blog/blog/2015/11/26/standard-sqljson-and-mysql-5-7-json/

0
On
0
On

JSON data type available is now supported in MySQL 5.7.8. It is very clearly documented: https://dev.mysql.com/doc/refman/5.7/en/json.html