Re: making the backend's json parser work in frontend code

David Steele <david@pgmasters.net>

From: David Steele <david@pgmasters.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-01-17T17:41:10Z
Lists: pgsql-hackers
Hi Robert,

On 1/16/20 11:51 AM, Robert Haas wrote:
> On Thu, Jan 16, 2020 at 1:37 PM David Steele <david@pgmasters.net> wrote:
> 
>> So the idea here is that json.c will have the JSON SQL functions,
>> jsonb.c the JSONB SQL functions, and jsonapi.c the parser, and
>> jsonfuncs.c the utility functions?
> 
> Uh, I think roughly that, yes. Although I can't claim to fully
> understand everything that's here.

Now that I've spent some time with the code I see your intent was just 
to isolate the JSON lexer code with 0002 and 0003.  As such, I now think 
they are commit-able as is.

Regards,
-- 
-David
david@pgmasters.net



Commits

  1. Add jsonapi.c to Mkvcbuild.pm's @pgcommonallfiles.

  2. Move jsonapi.c and jsonapi.h to src/common.

  3. Move some code from jsonapi.c to jsonfuncs.c.

  4. Adjust pg_parse_json() so that it does not directly ereport().

  5. Remove jsonapi.c's lex_accept().

  6. Split JSON lexer/parser from 'json' data type support.

  7. Rationalize code placement between wchar.c, encnames.c, and mbutils.c.

  8. Move wchar.c and encnames.c to src/common/.

  9. Update header comments for wchar.c and encnames.c.

  10. Make StringInfo available to frontend code.

  11. Use SASLprep to normalize passwords for SCRAM authentication.