Re: How to remove "enter" or new line

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: How to remove "enter" or new line
Дата
Msg-id AANLkTinE7xFPywx9TT8qo+Y0BaFjAgiWVOet+FFtYh_s@mail.gmail.com
обсуждение исходный текст
Ответ на How to remove "enter" or new line  (paulo matadr <saddoness@yahoo.com.br>)
Список pgsql-general
On 14 October 2010 14:59, paulo matadr <saddoness@yahoo.com.br> wrote:
>
> Hi Gurus,
>
>
> How to remove "enter" or new line from varchar field, I believed  be chr(10)
> and chr(13).

You can use regexp_replace.  For example:

regexp_replace(column, '\r|\n', '', 'g')

Bear in mind, the above example would mean that if there was no
whitespace between the newline and the words either side of it, they
would effectively be concatenated, so you may wish to replace with a
space, or use a better regular expression.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: How to iterate fields into a NEW.* RECORD in a TRIGGER procedure ?
Следующее
От: Vick Khera
Дата:
Сообщение: Re: Copying data files to new hardware?