On Mon, Sep 20, 2010 at 1:38 PM, Joseph Adams <joeyadams3.14...@gmail.com> wrote: > I have written a patch that amends the basic_json-20100915.patch .
Thanks. I merged your patch and added json_to_array(), as a demonstration of json_stringify(). As the current code, json_stringify(json) just returns the input text as-is, but json_stringify(json, NULL) trims all of unnecessary whitespaces. We could do it in json_in() and json_parse() and always store values in compressed representation instead. We leave room for discussion. I also merge json_test_strings.sql into the main test file. I slimed some tests -- many test cases seem to be duplicated for me. > I went ahead and added json_validate() now because it's useful for > testing (my test strings use it). Good idea, but how about calling it json_is_well_formed()? We have similar name of functions for xml type. I renamed it in the patch. > Here's one thing I'm worried about: the bison/flex code in your patch > looks rather similar to the code in > http://www.jsonlint.com/bin/jsonval.tgz , which is licensed under the > GPL. In particular, the incorrect number regex I discussed above can > also be found in jsonval verbatim. However, because there are a lot > of differences in both the bison and flex code now, I'm not sure > they're close enough to be "copied", but I am not a lawyer. It might > be a good idea to contact Ben Spencer and ask him for permission to > license our modified version of the code under PostgreSQL's more > relaxed license, just to be on the safe side. Sorry for my insincere manner. Surely I read his code. Do you know his contact address? I cannot find it... -- Itagaki Takahiro
basic_json-20100921.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers