Re: trim(both) problem? - Mailing list pgsql-sql

From Fernando Hevia
Subject Re: trim(both) problem?
Date
Msg-id 031701c8a717$c7458e90$8f01010a@iptel.com.ar
Whole thread Raw
In response to Re: trim(both) problem?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: trim(both) problem?
List pgsql-sql
 

> -----Mensaje original-----
> De: pgsql-sql-owner@postgresql.org 
> [mailto:pgsql-sql-owner@postgresql.org] En nombre de Stephan Szabo
> Enviado el: Viernes, 25 de Abril de 2008 17:46
> Para: Emi Lu
> CC: pgsql-sql@postgresql.org
> Asunto: Re: [SQL] trim(both) problem?
> 
> On Fri, 25 Apr 2008, Emi Lu wrote:
> 
> > Hi,
> >
> > Isn't this a bug about trim both.
> >
> >   select trim(both '<BR/>' from '<BR/>ROI Engineering Inc.');
> >          btrim
> > ---------------------
> >   OI Engineering Inc.
> > (1 row)
> >
> >
> > "R" is missing? How?
> 
> Trim doesn't do what you think it does. The '<BR/>' in the 
> above is not a string to remove it is a list of characters to 
> remove.  Thus, the R is removed as it matches a character given.
> 

You could probably use instead:

select replace('<BR/>ROI Engineering Inc.', '<BR/>', '')




pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: trim(both) problem?
Next
From: Tom Lane
Date:
Subject: Re: trim(both) problem?