Known issues with JSON field type?
I am using MonetDB 11.19.9 and using a JSON field type in my database. I am new to MonetDB and experienced with SQL and databases. I find when I try to store some json strings that I think are valid json, the database complains on row insert. For example, the following don't work: insert into foo (jdata) values ('["a", "b\\c"]'); insert into foo (jdata) values ('{"abc": ""}'); The first problem is with the quoted backslash. The second problem is with the double quotes. If I remove the quoted backslash it works, likewise replace double quotes with null and it works. This is my table create: create table foo ( jdata json ); My read of the JSON spec is that this is legal JSON. Are there known issues with JSON support in MonetDB? Thank you, Michael Helmke
Hi Michael, Since \ is used for escaping characters and " is/can also be a string delimiter, using these within a json object that is inserted in a database, can be tricky. It might also depend on how you do the insertion, for example if you use mclient or if you use for example jdbc from code. How do you try to insert these records and what happens if you try something like this: insert into foo (jdata) values ('["a", "b\\\\c"]'); insert into foo (jdata) values ('{"abc": \"\"}'); And which version of monetdb are you using? Arjen de Rijke ----- Original Message -----
From: "Michael Helmke"
To: users-list@monetdb.org Sent: Tuesday, May 19, 2015 3:42:28 AM Subject: Known issues with JSON field type?
I am using MonetDB 11.19.9 and using a JSON field type in my database. I am new to MonetDB and experienced with SQL and databases.
I find when I try to store some json strings that I think are valid json, the database complains on row insert.
For example, the following don't work:
insert into foo (jdata) values ('["a", "b\\c"]');
insert into foo (jdata) values ('{"abc": ""}');
The first problem is with the quoted backslash. The second problem is with the double quotes. If I remove the quoted backslash it works, likewise replace double quotes with null and it works.
This is my table create:
create table foo ( jdata json );
My read of the JSON spec is that this is legal JSON. Are there known issues with JSON support in MonetDB?
Thank you,
Michael Helmke _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Arjen de Rijke
-
Michael Helmke