Re: Speeding up loops in pl/pgsql function

Поиск
Список
Период
Сортировка
От Reuven M. Lerner
Тема Re: Speeding up loops in pl/pgsql function
Дата
Msg-id 4DE73277.9010308@lerner.co.il
обсуждение исходный текст
Ответ на Re: Speeding up loops in pl/pgsql function  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-performance
Hi, Merlin.  You wrote:

> select string_agg(v, '') from (select
> ascii(regexp_split_to_table('abc', $$\s*$$))::text as v) q;
Wow.   I've been programming with pl/pgsql for a good number of years,
but only now do I see the amazing usefulness of regexp_split_to_table
and string_agg, neither of which I really used until now.  Thanks for
both the solution and for opening my eyes.
> (what about 3 digit ascii codes?)
I have to put the number into a text field anyway, so I've been
converting the resulting number to text, and then using lpad to add
leading zeroes as necessary.

Thanks again,

Reuven

--
Reuven M. Lerner -- Web development, consulting, and training
Mobile: +972-54-496-8405 * US phone: 847-230-9795
Skype/AIM: reuvenlerner


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

Предыдущее
От: Jarrod Chesney
Дата:
Сообщение: Re: Delete performance
Следующее
От: Jenish
Дата:
Сообщение: Re: Strange behavior of child table.