Re: users-list Digest, Vol 33, Issue 14
Hi, Thank you for your reply. I am using mclient to do the inserts. For your question about the monetdb version, I get "MonetDB Database Server Toolkit v1.1 (Oct2014-SP3)" from the monetdb --version switch. If I insert "b\\\\c" that does work fine. And I tried doubling all of the backslashes which worked until I got unicode characters of the form: \\u03c1 for example. That case then doesn't work. Adding backslash escapes on the quotes in my second example didn't change anything. In the short term, I'm going to skip json and simply store strings. I'm also playing with the json parser in the code to do tests and see if I can find a simple fix or workaround there. Thank you, Michael Helmke
Date: Tue, 19 May 2015 08:46:29 +0200 (CEST) From: Arjen de Rijke
To: Communication channel for MonetDB users Subject: Re: Known issues with JSON field type? Message-ID: <1281096997.870323.1432017989628.JavaMail.zimbra@cwi.nl> Content-Type: text/plain; charset=utf-8 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 (1)
-
Michael Helmke