Re: proposal: support empty string as separator for string_to_array

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: support empty string as separator for string_to_array
Дата
Msg-id 162867790907250730o43b25956lc76e0ffac0ebe021@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: support empty string as separator for string_to_array  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
2009/7/25 Merlin Moncure <mmoncure@gmail.com>:
> On Fri, Jul 24, 2009 at 11:40 PM, Pavel Stehule<pavel.stehule@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 is inversion of array_to_string function behave:
>>
>> postgres=# select array_to_string(array['a','b','c'],'');
>>  array_to_string
>> -----------------
>>  abc
>> (1 row)
>>
>> postgres=# select string_to_array('abc','');
>>  string_to_array
>> -----------------
>>  {a,b,c}
>> (1 row)
>
> postgres=# select regexp_split_to_array('abc', '');
>  regexp_split_to_array
> -----------------------
>  {a,b,c}
> (1 row)

I know - but regexp is not necessary - simply function for string
decomposition should be faster and little bit more intuitive. Not
everybody understand reg exp.

Pavel
>
> :-)
>
> merlin
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: proposal: support empty string as separator for string_to_array
Следующее
От: Tom Lane
Дата:
Сообщение: Re: autogenerating headers & bki stuff