Re: [HACKERS] jsonb generator functions

2014-12-12 Thread Andrew Dunstan
On 12/12/2014 01:55 PM, Tom Lane wrote: Andrew Dunstan writes: Also here is a patch factored out which applies the find_coercion_pathway change to json.c. I'm inclined to say we should backpatch this to 9.4 (and with a small change 9.3). Thoughts? Meh. Maybe I'm just feeling gunshy because I

Re: [HACKERS] jsonb generator functions

2014-12-12 Thread Tom Lane
Andrew Dunstan writes: >> Also here is a patch factored out which applies the >> find_coercion_pathway change to json.c. I'm inclined to say we should >> backpatch this to 9.4 (and with a small change 9.3). Thoughts? Meh. Maybe I'm just feeling gunshy because I broke something within the past

Re: [HACKERS] jsonb generator functions

2014-12-12 Thread Andrew Dunstan
On 12/12/2014 01:10 PM, Andrew Dunstan wrote: On 12/08/2014 01:00 PM, Andrew Dunstan wrote: On 12/08/2014 04:21 AM, Alvaro Herrera wrote: Andrew Dunstan wrote: OK, here is a new patch version that * uses find_coercion_path() to find the cast function if any, as discussed elsewhere

Re: [HACKERS] jsonb generator functions

2014-12-12 Thread Andrew Dunstan
On 12/08/2014 01:00 PM, Andrew Dunstan wrote: On 12/08/2014 04:21 AM, Alvaro Herrera wrote: Andrew Dunstan wrote: OK, here is a new patch version that * uses find_coercion_path() to find the cast function if any, as discussed elsewhere * removes calls to getTypeOutputInfo() except w

Re: [HACKERS] jsonb generator functions

2014-12-08 Thread Andrew Dunstan
On 12/08/2014 04:21 AM, Alvaro Herrera wrote: Andrew Dunstan wrote: OK, here is a new patch version that * uses find_coercion_path() to find the cast function if any, as discussed elsewhere * removes calls to getTypeOutputInfo() except where required * honors a cast to json only for

Re: [HACKERS] jsonb generator functions

2014-12-08 Thread Alvaro Herrera
Andrew Dunstan wrote: > OK, here is a new patch version that > > * uses find_coercion_path() to find the cast function if any, as >discussed elsewhere > * removes calls to getTypeOutputInfo() except where required > * honors a cast to json only for rendering both json and jsonb > * adds p

Re: [HACKERS] jsonb generator functions

2014-11-07 Thread Andrew Dunstan
On 10/28/2014 09:49 AM, Andrew Dunstan wrote: On 10/27/2014 05:57 PM, Alvaro Herrera wrote: Anyway this whole business of searching through the CASTSOURCETARGET syscache seems like it could be refactored. If I'm counting correctly, that block now appears four times (three in this patch, once

Re: [HACKERS] jsonb generator functions

2014-10-28 Thread Andrew Dunstan
On 10/27/2014 05:57 PM, Alvaro Herrera wrote: Andrew Dunstan wrote: This bit: +/* + * Determine how we want to render values of a given type in datum_to_jsonb. + * + * Given the datatype OID, return its JsonbTypeCategory, as well as the type's + * output function OID. If the returned categor

Re: [HACKERS] jsonb generator functions

2014-10-28 Thread Alvaro Herrera
Andrew Dunstan wrote: This bit: > +/* > + * Determine how we want to render values of a given type in datum_to_jsonb. > + * > + * Given the datatype OID, return its JsonbTypeCategory, as well as the > type's > + * output function OID. If the returned category is JSONBTYPE_CAST, we > + * return

Re: [HACKERS] jsonb generator functions

2014-10-27 Thread Pavel Stehule
Hi 2014-10-27 15:33 GMT+01:00 Andrew Dunstan : > > On 10/15/2014 03:54 PM, Andrew Dunstan wrote: > >> >> >>> I checked a code, and I have only two small objection - a name >>> "jsonb_object_two_arg" is not good - maybe "json_object_keys_values" ? >>> >> >> It's consistent with the existing json_o

Re: [HACKERS] jsonb generator functions

2014-10-27 Thread Andrew Dunstan
On 10/15/2014 03:54 PM, Andrew Dunstan wrote: I checked a code, and I have only two small objection - a name "jsonb_object_two_arg" is not good - maybe "json_object_keys_values" ? It's consistent with the existing json_object_two_arg. In all cases I think I kept the names the same except

Re: [HACKERS] jsonb generator functions

2014-10-16 Thread Pavel Stehule
2014-10-15 23:49 GMT+02:00 Andrew Dunstan : > > On 10/15/2014 05:47 PM, Alvaro Herrera wrote: > >> Andrew Dunstan wrote: >> >> If we really want to change the name of json_object_two_arg, it >>> would probably be best to change it NOW in 9.4 before it gets out >>> into a production release at all

Re: [HACKERS] jsonb generator functions

2014-10-15 Thread Andrew Dunstan
On 10/15/2014 05:47 PM, Alvaro Herrera wrote: Andrew Dunstan wrote: If we really want to change the name of json_object_two_arg, it would probably be best to change it NOW in 9.4 before it gets out into a production release at all. Doesn't it require initdb? If so, I think it's too late now.

Re: [HACKERS] jsonb generator functions

2014-10-15 Thread Alvaro Herrera
Andrew Dunstan wrote: > If we really want to change the name of json_object_two_arg, it > would probably be best to change it NOW in 9.4 before it gets out > into a production release at all. Doesn't it require initdb? If so, I think it's too late now. -- Álvaro Herrerahttp://w

Re: [HACKERS] jsonb generator functions

2014-10-15 Thread Andrew Dunstan
On 10/15/2014 03:54 PM, I wrote: On 10/15/2014 07:38 AM, Pavel Stehule wrote: I checked a code, and I have only two small objection - a name "jsonb_object_two_arg" is not good - maybe "json_object_keys_values" ? It's consistent with the existing json_object_two_arg. In all cases I think

Re: [HACKERS] jsonb generator functions

2014-10-15 Thread Andrew Dunstan
On 10/15/2014 07:38 AM, Pavel Stehule wrote: 2014-10-13 17:22 GMT+02:00 Andrew Dunstan >: On 10/13/2014 09:37 AM, Andrew Dunstan wrote: On 09/26/2014 04:54 PM, Andrew Dunstan wrote: Here is a patch for the generator and aggregate funct

Re: [HACKERS] jsonb generator functions

2014-10-15 Thread Pavel Stehule
2014-10-13 17:22 GMT+02:00 Andrew Dunstan : > > On 10/13/2014 09:37 AM, Andrew Dunstan wrote: > >> >> On 09/26/2014 04:54 PM, Andrew Dunstan wrote: >> >>> >>> Here is a patch for the generator and aggregate functions for jsonb that >>> we didn't manage to get done in time for 9.4. They are all equ

Re: [HACKERS] jsonb generator functions

2014-10-13 Thread Andrew Dunstan
On 10/13/2014 09:37 AM, Andrew Dunstan wrote: On 09/26/2014 04:54 PM, Andrew Dunstan wrote: Here is a patch for the generator and aggregate functions for jsonb that we didn't manage to get done in time for 9.4. They are all equivalents of the similarly names json functions. Included are

Re: [HACKERS] jsonb generator functions

2014-10-13 Thread Andrew Dunstan
On 09/26/2014 04:54 PM, Andrew Dunstan wrote: Here is a patch for the generator and aggregate functions for jsonb that we didn't manage to get done in time for 9.4. They are all equivalents of the similarly names json functions. Included are to_jsonb jsonb_build_object jsonb_bui

Re: [HACKERS] jsonb generator functions

2014-09-26 Thread Andrew Dunstan
On 09/26/2014 05:00 PM, Peter Geoghegan wrote: On Fri, Sep 26, 2014 at 1:54 PM, Andrew Dunstan wrote: Here is a patch for the generator and aggregate functions for jsonb that we didn't manage to get done in time for 9.4. That's cool, but I hope someone revisits adding a concatenate operator.

Re: [HACKERS] jsonb generator functions

2014-09-26 Thread Peter Geoghegan
On Fri, Sep 26, 2014 at 1:54 PM, Andrew Dunstan wrote: > Here is a patch for the generator and aggregate functions for jsonb that we > didn't manage to get done in time for 9.4. That's cool, but I hope someone revisits adding a concatenate operator. That's a biggest omission IMHO. I'm not going