Re: trim() spec

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: SAKAIDA Masaaki <sakaida(at)psn(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: trim() spec
Date: 2000-06-13 08:04:15
Message-ID: 200006130804.EAA24887@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Can someone comment on this?

> 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
>
>
>

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • trim() spec at 2000-06-03 03:28:56 from SAKAIDA Masaaki

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2000-06-13 08:09:20 Re: memory management suggestion
Previous Message Tom Lane 2000-06-13 08:01:12 Re: rules on INSERT can't UPDATE new instance?