Re: Removing spaces

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: Dave Smith <dave(dot)smith(at)candata(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Removing spaces
Date: 2003-02-19 18:26:07
Message-ID: 200302191126.07812.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-02-19 18:39:10 Re: creating table
Previous Message Dave Smith 2003-02-19 18:19:32 Removing spaces