Why not? I feel like a database should allow for a JSON data type that stores only valid JSON or throws an exception. It would also be nice to be able to access subfields of the JSON.
SELECT userid, username, some_json_field["some_subfield"][0] FROM users where ...
Not sure where to give feature suggestions so I'm just leaving this here for future devs to find
create table foo(my_json json);
insert into foo values ('{"a":{"b":{"c":"d"}}}' FORMAT JSON);
select (my_json)."a"."b"."c" from foo; -- where the () around the field is mandatory
https://h2database.com/html/grammar.html#field_referenceNot that it's not _useful_ sometimes, but it amuses me that this is a huge violation of 1NF and people are often ok with it. It really depends on whether you're treating the JSON object as an atomic unit on its own, regardless of contents, or using the JSON to store more fine-grained information.
I guess the same argument can be made for XML data types, and everyone's OK with it too.
They are successful beyond anything that I can imagine people expecting when creating them. But they are not that complete silver bullet that solves every problem humanity will ever need solved.
You can access subfields using `json_` and `jsonb_` functions.
There is no json data type ! If you are just storing json blobs, then the BLOB or TEXT data types will be the best picks.