Re: Removing spaces - Mailing list pgsql-general

From Ed L.
Subject Re: Removing spaces
Date
Msg-id 200302191126.07812.pgsql@bluepolka.net
Whole thread Raw
In response to Removing spaces  (Dave Smith <dave.smith@candata.com>)
List pgsql-general
On Wednesday February 19 2003 11:19, Dave Smith wrote:
> I have a field of type text that has a value like
>
> 'hello   \nworld   \n'
>
> I would like to remove the trailing blanks between the last
> character and the newline. I would like to use replace with a regx
> like /[ ]+\n/\n/ but it does not seem to work.

You might try combining UPDATE with some of the string functions;
trim() + '\n' comes to mind.

http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/functions-string.html

Ed


pgsql-general by date:

Previous
From: Dave Smith
Date:
Subject: Removing spaces
Next
From: Richard Huxton
Date:
Subject: Re: creating table