Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Pavel Stehule
2009/7/25 Merlin Moncure mmonc...@gmail.com: On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehulepavel.steh...@gmail.com wrote: Hello I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Kevin Grittner
Pavel Stehule pavel.steh...@gmail.com wrote: I tested implementation and it's about 30% faster than using regexp. Rather than making a change which could break existing applications, how about a new function string_to_array(text) which returns an array of char? -Kevin -- Sent via

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Pavel Stehule
2009/7/27 Kevin Grittner kevin.gritt...@wicourts.gov: Pavel Stehule pavel.steh...@gmail.com wrote: I tested  implementation and it's about 30% faster than using regexp. Rather than making a change which could break existing applications, how about a new function string_to_array(text) which

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Merlin Moncure
On Mon, Jul 27, 2009 at 12:42 PM, Pavel Stehulepavel.steh...@gmail.com wrote: 2009/7/25 Merlin Moncure mmonc...@gmail.com: On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehulepavel.steh...@gmail.com wrote: Hello I have one idea, that should simplify string to char array transformation. The base

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: I tested implementation and it's about 30% faster than using regexp. In a real application, that's going to be negligible compared to all the other costs involved in pushing the data around. And we still haven't seen any in-the-field requests for

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-27 Thread Pavel Stehule
2009/7/27 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I tested  implementation and it's about 30% faster than using regexp. In a real application, that's going to be negligible compared to all the other costs involved in pushing the data around.  And we still

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-25 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehulepavel.steh...@gmail.com wrote: Hello I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular separator for string_to_array function. This behave

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-25 Thread Pavel Stehule
2009/7/25 Merlin Moncure mmonc...@gmail.com: On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehulepavel.steh...@gmail.com wrote: Hello I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular separator for string_to_array function. There already is a definition for what

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-25 Thread Pavel Stehule
2009/7/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular separator for string_to_array function. There

Re: [HACKERS] proposal: support empty string as separator for string_to_array

2009-07-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2009/7/25 Tom Lane t...@sss.pgh.pa.us: There already is a definition for what string_to_array does with an empty field separator, and that is not it. I thing, so nobody use empty separator in string_to_array, because it does nothing useful.

[HACKERS] proposal: support empty string as separator for string_to_array

2009-07-24 Thread Pavel Stehule
Hello I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular separator for string_to_array function. This behave is inversion of array_to_string function behave: postgres=# select