Re: Proposal: json_populate_record and nested json objects

From: Chris Travers <chris(at)2ndquadrant(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: json_populate_record and nested json objects
Date: 2013-09-16 13:57:19
Message-ID: 1361412433.252897.1379339839458.open-xchange@email.1and1.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 16 September 2013 at 14:43 Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:

>
> Huge +1 on on this. Couple random thoughts:
>
> *) Hard to see how you would structure this as an extension as you're
> adjusting the behaviors of existing functions, unless you wanted to
> introduce new function names for testing purposes?

Yeah, and reading the source, it looks like some parts of the JSON parsing code
will have to be rewritten because the nested object errors are thrown quite
deeply in the parsing stage. It looks to me as if this will require some
significant copying as a POC into a new file with different publicly exposed
function names.
>
> *) Would like to at least consider being able to use casting syntax as
> a replacement for "populate_record" and (the missing) "populate_array"
> for most usages.

Yes. I am trying to figure out how best to do this at present. Initially I
think I would be happy to settle for casts wrapping functions which themselves
just wrap the call to populate_record.

What I will probably do for my POC is expose the following methods:

1. json_populate_type()
2. json_populate_array()

Then we can talk about whether to merge the changes into the core,

This will be an interesting way to get into PostgreSQL hacking.

Best Wishes,
Chris Travers

>
> merlin
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
Best Wishes,
Chris Travers
http://www.2ndquadrant.com
PostgreSQL Services, Training, and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-09-16 13:59:28 Re: Freezing without write I/O
Previous Message Haribabu kommi 2013-09-16 13:52:39 Re: insert throw error when year field len > 4 for timestamptz datatype