Search Postgresql Archives

Re: How to remove "enter" or new line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14 October 2010 14:59, paulo matadr <saddoness@xxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux