Re: json api WIP patch - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: json api WIP patch
Date
Msg-id 50EB4913.1070003@dunslane.net
Whole thread Raw
In response to Re: json api WIP patch  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: json api WIP patch
Re: json api WIP patch
Re: json api WIP patch
List pgsql-hackers
On 01/07/2013 10:25 AM, Merlin Moncure wrote:

>
> the patch looks fabulous.  There are a few trivial whitespace issues
> yet and I noticed a leaked hstore comment@ 2440:
> +     /*
> +      * if the input hstore is empty, we can only skip the rest if we were
> +      * passed in a non-null record, since otherwise there may be issues with
> +      * domain nulls.
> +      */
>


Here is a patch that has all the functionality I'm intending to provide.

The API is improved some, with the parser now keeping track of the
nesting levels instead of callers having to do so, and a constructor
function provided for JsonLexContext objects.

The processing functions have been extended to provide populate_record()
and populate_recordset() functions.The latter in particular could be
useful in decomposing a piece of json representing an array of flat
objects (a fairly common pattern) into a set of Postgres records in a
single pass.

The main thing I'm going to concentrate on now is making sure that this
doesn't leak memory. I'm sure there's some tightening required in that
area. Any eyeballs there will be greatly appreciated. There are also a
couple of very minor things to clean up.

You (Merlin) have kindly volunteered to work on documentation, so before
we go too far with that any bikeshedding on names, or on the
functionality being provided, should now take place.


cheers

andrew

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: psql \l to accept patterns
Next
From: Robert Haas
Date:
Subject: Re: psql \l to accept patterns