Re: is it a bug? - Mailing list pgsql-general

From Tom Lane
Subject Re: is it a bug?
Date
Msg-id 14917.975424197@sss.pgh.pa.us
Whole thread Raw
In response to is it a bug?  ("He weiping" <laser@zhengmai.com.cn>)
List pgsql-general
"He weiping" <laser@zhengmai.com.cn> writes:
> but it seems the "lpad", "rpad" don't work,
> when I type:
> select lpad('laser', 4, 'a');
> in psql, the result is still=20
> 'laser', the same with 'rpad',
> Is it a bug or I'm mis-understaning the lpad and/or rpad functions?

lpad and rpad never truncate, they only pad.

Perhaps they *should* truncate if the specified length is less than
the original string length.  Does Oracle do that?

            regards, tom lane

pgsql-general by date:

Previous
From: "Martin A. Marques"
Date:
Subject: Re: Tuple size limits and upgrading
Next
From: Kenneth Been
Date:
Subject: large tuple