Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Andrew Dunstan
On 09/29/2014 04:32 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/29/2014 04:14 PM, Tom Lane wrote: More to the point, the way to fix any concerns about double parsing is to create row_to_jsonb(), not to plaster a bunch of options on row_to_json(). row_to_jsonb would be completely redunda

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Tom Lane
Andrew Dunstan writes: > On 09/29/2014 04:14 PM, Tom Lane wrote: >> More to the point, the way to fix any concerns about double parsing is to >> create row_to_jsonb(), not to plaster a bunch of options on row_to_json(). > row_to_jsonb would be completely redundant with to_jsonb() in my recent >

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Andrew Dunstan
On 09/29/2014 04:14 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/29/2014 03:23 PM, Pavel Stehule wrote: It is better than nothing, but it is not nice for JSON due 2x parsing. JSON parsing is actually pretty darn fast. Every json (as opposed to jsonb) function reparses the json. It's true

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Tom Lane
Andrew Dunstan writes: > On 09/29/2014 03:23 PM, Pavel Stehule wrote: >> It is better than nothing, but it is not nice for JSON due 2x parsing. > JSON parsing is actually pretty darn fast. Every json (as opposed to > jsonb) function reparses the json. It's true that this is not nearly as > fas

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Pavel Stehule
2014-09-29 22:03 GMT+02:00 Andrew Dunstan : > > On 09/29/2014 03:23 PM, Pavel Stehule wrote: > >> >> >> 2014-09-27 14:00 GMT+02:00 Stephen Frost > sfr...@snowman.net>>: >> >> Andrew, all, >> >> * Andrew Dunstan (and...@dunslane.net >> ) wrote: >> > I sho

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Andrew Dunstan
On 09/29/2014 03:23 PM, Pavel Stehule wrote: 2014-09-27 14:00 GMT+02:00 Stephen Frost >: Andrew, all, * Andrew Dunstan (and...@dunslane.net ) wrote: > I should have been paying a bit more attention to the recent work on

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Pavel Stehule
2014-09-29 21:23 GMT+02:00 Pavel Stehule : > > > 2014-09-27 14:00 GMT+02:00 Stephen Frost : > >> Andrew, all, >> >> * Andrew Dunstan (and...@dunslane.net) wrote: >> > I should have been paying a bit more attention to the recent work on >> > adding an ignore_nulls option to row_to_json(). Here are

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Pavel Stehule
2014-09-27 14:00 GMT+02:00 Stephen Frost : > Andrew, all, > > * Andrew Dunstan (and...@dunslane.net) wrote: > > I should have been paying a bit more attention to the recent work on > > adding an ignore_nulls option to row_to_json(). Here are some > > belated thought. I apologize to Pavel and Steph

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Pavel Stehule
2014-09-29 17:38 GMT+02:00 Stephen Frost : > * Andrew Dunstan (and...@dunslane.net) wrote: > > That said, doing this as an extension is probably a good way to go, > > as I suggested upthread, since we could then make it available for > > 9.4, rather than making people wait until 9.5. > > Two point

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Pavel Stehule
2014-09-28 18:35 GMT+02:00 Andrew Dunstan : > > On 09/27/2014 11:58 PM, Stephen Frost wrote: > >> All, >> >> >> On Saturday, September 27, 2014, Andrew Dunstan > > wrote: >> >> >> On 09/27/2014 10:52 PM, Tom Lane wrote: >> >> Andrew Dunstan writes: >> >>

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread David E. Wheeler
On Sep 29, 2014, at 9:09 AM, Tom Lane wrote: > I seem to recall that we've run into practical difficulties with moving > extensions into core. It might be OK for a functions-only extension > though. It does make upgrading difficult, though, as I’ve learned the hard way with when upgrading from

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Tom Lane
Stephen Frost writes: > * Andrew Dunstan (and...@dunslane.net) wrote: >> That said, doing this as an extension is probably a good way to go, >> as I suggested upthread, since we could then make it available for >> 9.4, rather than making people wait until 9.5. > Two points on this- having it in 9

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Stephen Frost
* Andrew Dunstan (and...@dunslane.net) wrote: > That said, doing this as an extension is probably a good way to go, > as I suggested upthread, since we could then make it available for > 9.4, rather than making people wait until 9.5. Two points on this- having it in 9.5 doesn't preclude someone fr

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Stephen Frost
Merlin, * Merlin Moncure (mmonc...@gmail.com) wrote: > Are you defining 'core' as 'supported by the core project' (in which > case I agree) or 'not an extension' (in which case I disagree). Which means you're suggesting it as an extension which lives in contrib..? Otherwise, I'm not following.

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Merlin Moncure
On Mon, Sep 29, 2014 at 9:45 AM, Stephen Frost wrote: > * Robert Haas (robertmh...@gmail.com) wrote: >> +1. I am sort of surprised that anyone things this null-stripping >> behavior is something that ought to be part of core PostgreSQL instead >> of, I don't know, relegated to an extension somewh

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Andrew Dunstan
On 09/29/2014 10:38 AM, Robert Haas wrote: On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan wrote: On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/27/2014 06:27 PM, Tom Lane wrote: So my vote is for a separate function and no optional arguments. You mean like row_to_j

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > +1. I am sort of surprised that anyone things this null-stripping > behavior is something that ought to be part of core PostgreSQL instead > of, I don't know, relegated to an extension somewhere far from the > bright center of the galaxy. I've never

Re: [HACKERS] json (b) and null fields

2014-09-29 Thread Robert Haas
On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan wrote: > On 09/27/2014 10:52 PM, Tom Lane wrote: >> Andrew Dunstan writes: >>> On 09/27/2014 06:27 PM, Tom Lane wrote: So my vote is for a separate function and no optional arguments. >>> >>> You mean like row_to_json_no_nulls() and json_

Re: [HACKERS] json (b) and null fields

2014-09-28 Thread Andrew Dunstan
On 09/27/2014 11:58 PM, Stephen Frost wrote: All, On Saturday, September 27, 2014, Andrew Dunstan > wrote: On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/27/2014 06:27 PM, Tom Lane wrote: So my vote

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Stephen Frost
All, On Saturday, September 27, 2014, Andrew Dunstan wrote: > > On 09/27/2014 10:52 PM, Tom Lane wrote: > >> Andrew Dunstan writes: >> >>> On 09/27/2014 06:27 PM, Tom Lane wrote: >>> So my vote is for a separate function and no optional arguments. >>> You mean like row_to_json_no_null

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Andrew Dunstan
On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/27/2014 06:27 PM, Tom Lane wrote: So my vote is for a separate function and no optional arguments. You mean like row_to_json_no_nulls() and json_agg_no_nulls()? I thought you were proposing that we should revert the commit

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Tom Lane
Andrew Dunstan writes: > On 09/27/2014 06:27 PM, Tom Lane wrote: >> So my vote is for a separate function and no optional arguments. > You mean like row_to_json_no_nulls() and json_agg_no_nulls()? I thought you were proposing that we should revert the committed patch lock-stock-n-barrel, and ins

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Andrew Dunstan
On 09/27/2014 06:27 PM, Tom Lane wrote: Andrew Dunstan writes: On 09/27/2014 08:00 AM, Stephen Frost wrote: Yeah, I don't see adding this option to all json generator functions as making a lot of sense but rather just to the select few things which it really makes sense for and then having a

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Tom Lane
Andrew Dunstan writes: > On 09/27/2014 08:00 AM, Stephen Frost wrote: >> Yeah, I don't see adding this option to all json generator functions as >> making a lot of sense but rather just to the select few things which it >> really makes sense for and then having a function which can be used by >> u

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Andrew Dunstan
On 09/27/2014 08:00 AM, Stephen Frost wrote: Andrew, all, * Andrew Dunstan (and...@dunslane.net) wrote: I should have been paying a bit more attention to the recent work on adding an ignore_nulls option to row_to_json(). Here are some belated thought. I apologize to Pavel and Stephen for not h

Re: [HACKERS] json (b) and null fields

2014-09-27 Thread Stephen Frost
Andrew, all, * Andrew Dunstan (and...@dunslane.net) wrote: > I should have been paying a bit more attention to the recent work on > adding an ignore_nulls option to row_to_json(). Here are some > belated thought. I apologize to Pavel and Stephen for not having > commented earlier. No problem at a

[HACKERS] json (b) and null fields

2014-09-26 Thread Andrew Dunstan
I should have been paying a bit more attention to the recent work on adding an ignore_nulls option to row_to_json(). Here are some belated thought. I apologize to Pavel and Stephen for not having commented earlier. I think this is really a bandaid, and it will fail to catch lots of cases. Seve