Search Postgresql Archives

Re: String trim function - possible bug?

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

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[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