trim() spec - Mailing list pgsql-hackers

From SAKAIDA Masaaki
Subject trim() spec
Date
Msg-id 39387B7815E.3091SAKAIDA@smtp.psn.ne.jp
Whole thread Raw
Responses Re: trim() spec  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Hi,

Can you tell me trim() spec, please ? (This problem has been 
discussed in pgsql-jp ML. )

In trim(trailing 'abc' from '123cbabc') function, 'abc' means
~'[abc]'. 

pgbash> select trim(trailing 'abc' from '123cbabc');
rtrim
----- 123   <==== it is not "123cb"!!
(1 row)


In current trim() function, MULTIBYTE string is broken.

pgbash> select trim(trailing '0x8842' from '0xB1428842');                               --~~            ~~--~~
rtrim
-----0xB1   <==== MULTIBYTE string broken (This is a bug.)
(1 row)


If trim(trailing 'abc' from '123cbabc') returns "123cb", current 
trim() spec is broken. However, the spec that 'abc' means ~'[abc]' 
is ugly. It seems that this ugly spec isn't used for any kind of
functions argument and SQL expression except for trim().

How do you think about the trim() spec ?

--
Regards,
SAKAIDA Masaaki  -- Osaka, Japan




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problems with recent CVS versions and Solaris.
Next
From: Bruce Momjian
Date:
Subject: New warning code for missing FROM relations