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

2009-07-27 Thread Pavel Stehule
2009/7/27 Tom Lane : > Pavel Stehule 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 reques

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

2009-07-27 Thread Tom Lane
Pavel Stehule 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 this functionality, so e

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 Stehule wrote: > 2009/7/25 Merlin Moncure : >> On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehule >> wrote: >>> Hello >>> >>> I have one idea, that should simplify string to char array >>> transformation. The base is idea: between every char is empty string, >>

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

2009-07-27 Thread Pavel Stehule
2009/7/27 Kevin Grittner : > Pavel Stehule 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"? yes, it was

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

2009-07-27 Thread Kevin Grittner
Pavel Stehule 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 pgsql-hackers mailing lis

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

2009-07-27 Thread Pavel Stehule
2009/7/25 Merlin Moncure : > On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehule > 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 funct

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

2009-07-25 Thread Tom Lane
Pavel Stehule writes: > 2009/7/25 Tom Lane : >> 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. According to you, maybe not. But perha

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

2009-07-25 Thread Pavel Stehule
2009/7/25 Tom Lane : > Pavel Stehule 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 strin

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

2009-07-25 Thread Tom Lane
Pavel Stehule 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 string_to_array does with an empty

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

2009-07-25 Thread Pavel Stehule
2009/7/25 Merlin Moncure : > On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehule > 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 funct

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 Stehule 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 is inversion of ar

[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 array_to_string(