Re: Is there an easy way to normalize-space with given string functions
В списке pgsql-sql по дате отправления:
| От | Janning Vygen |
|---|---|
| Тема | Re: Is there an easy way to normalize-space with given string functions |
| Дата | |
| Msg-id | 200404231137.21445.vygen@gmx.de обсуждение исходный текст |
| Ответ на | Re: Is there an easy way to normalize-space with given string functions (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-sql |
Am Freitag, 23. April 2004 04:34 schrieb Tom Lane:
> Janning Vygen <vygen@gmx.de> writes:
> > i searched the function list and tried to combine to or more
> > functions, but i miss a replace function which uses regular
> > expressions.
>
> There isn't one in the SQL standard. Most people who need one write a
> one-liner function in plperl or pltcl.
Thank you.
> (Mind you, I don't know why we don't offer a built-in one --- the needed
> regex engine is in there anyway. I guess no one has gotten around to
> getting agreement on a syntax.)
My suggestion:
Syntax:
substitute(string text, from text, to text);
Example:
substitute(' too many spaces ', '\s+', ' ');
Result:
' too many spaces '
But maybe its a bad idea to create new function names...
kind regards
janning
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера