Re: String trim function - possible bug? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: String trim function - possible bug?
Date
Msg-id 20070606165014.GE8997@svana.org
Whole thread Raw
In response to String trim function - possible bug?  ("Woody Woodring" <george.woodring@iglass.net>)
List pgsql-general
On Wed, Jun 06, 2007 at 12:21:33PM -0400, Woody Woodring wrote:
> I am seeing weirdness using the trim function on a string:

<snip>

You are missunderstanding the trim function.

> However it fails for these cases:
>
> SELECT 'dhct:dn', trim(leading 'dhct:' from 'dhct:dn');
>  ?column? | ltrim
> ----------+-------
>  dhct:dn  | n
> (1 row)

The bit after the leading is the set of *characters* to be removed.
Like so:

# select trim( leading 'dhct:' from 'dhdhda');
 ltrim
-------
 a
(1 row)

It's matching characters, not the exact string...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Woody Woodring"
Date:
Subject: String trim function - possible bug?
Next
From: Stephan Szabo
Date:
Subject: Re: String trim function - possible bug?