Re: Making substrings uppercase
От
Oliver Kohll - Mailing Lists
Тема
Re: Making substrings uppercase
Дата
Msg-id
6216DAAF-2DFC-4B8E-951E-FACBF5C29A9D@gtwm.co.uk
Ответ на
Re: Making substrings uppercase (Alvaro Herrera)
Список
Дерево обсуждения
Making substrings uppercase Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>
Re: Making substrings uppercase David Johnston <polobo@yahoo.com>
invalid resource manager ID in primary checkpoint record "ascot.moss@gmail.com" <ascot.moss@gmail.com>
Re: invalid resource manager ID in primary checkpoint record "ascot.moss@gmail.com" <ascot.moss@gmail.com>
fsync and wal_sync_method "ascot.moss@gmail.com" <ascot.moss@gmail.com>
Re: fsync and wal_sync_method bricklen <bricklen@gmail.com>
Re: Making substrings uppercase Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>
Re: Making substrings uppercase Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Making substrings uppercase Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>
Re: Making substrings uppercase Merlin Moncure <mmoncure@gmail.com>
On 9 Sep 2013, at 21:03, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
select string_agg(case when words like '*%*' then upper(btrim(words, '*')) else words end, ' ')
from regexp_split_to_table('The *quick* *brown* fox jumped over the *lazy* dog', ' ') as words;
string_agg
----------------------------------------------
The QUICK BROWN fox jumped over the LAZY dog
That's quite elegant. In the end I exported and used PERL, as some of my 'words' had spaces (they were ingredients like monosodium glutamate), but you could probably do a more complex regex in regexp_split_to_table to cope with that, or use pl/perl as previously suggested.
Thanks
Oliver
В списке pgsql-general по дате отправления