Skip site navigation (1) Skip section navigation (2)

Re: json api WIP patch

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json api WIP patch
Date: 2013-01-07 22:15:47
Message-ID: 50EB4913.1070003@dunslane.net (view raw or flat)
Thread:
Lists: 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: jsonapi3.patch
Description: text/x-patch (106.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2013-01-07 22:37:13
Subject: Re: psql \l to accept patterns
Previous:From: Peter EisentrautDate: 2013-01-07 22:14:43
Subject: Re: psql \l to accept patterns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group