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.