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

2014-09-29 Thread Robert Haas
On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan and...@dunslane.net wrote: On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan and...@dunslane.net 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

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 Andrew Dunstan
On 09/29/2014 10:38 AM, Robert Haas wrote: On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan and...@dunslane.net wrote: On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: On 09/27/2014 06:27 PM, Tom Lane wrote: So my vote is for a separate function and no

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 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 from

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

2014-09-29 Thread Merlin Moncure
On Mon, Sep 29, 2014 at 9:45 AM, Stephen Frost sfr...@snowman.net 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

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

2014-09-29 Thread Tom Lane
Stephen Frost sfr...@snowman.net 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-

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

2014-09-29 Thread David E. Wheeler
On Sep 29, 2014, at 9:09 AM, Tom Lane t...@sss.pgh.pa.us 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

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

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

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

2014-09-29 Thread Pavel Stehule
2014-09-29 17:38 GMT+02:00 Stephen Frost sfr...@snowman.net: * 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.

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

2014-09-29 Thread Pavel Stehule
2014-09-27 14:00 GMT+02:00 Stephen Frost sfr...@snowman.net: 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

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

2014-09-29 Thread Pavel Stehule
2014-09-29 21:23 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2014-09-27 14:00 GMT+02:00 Stephen Frost sfr...@snowman.net: 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

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 and...@dunslane.net 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

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 all

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

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

2014-09-27 Thread Tom Lane
Andrew Dunstan and...@dunslane.net 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

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 and...@dunslane.net 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

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

2014-09-27 Thread Tom Lane
Andrew Dunstan and...@dunslane.net 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

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

2014-09-27 Thread Stephen Frost
All, On Saturday, September 27, 2014, Andrew Dunstan and...@dunslane.net wrote: On 09/27/2014 10:52 PM, Tom Lane wrote: Andrew Dunstan and...@dunslane.net 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

[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.