Skip site navigation (1) Skip section navigation (2)

Re: is it a bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "He weiping" <laser(at)zhengmai(dot)com(dot)cn>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: is it a bug?
Date: 2000-11-28 15:09:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-hackers
"He weiping" <laser(at)zhengmai(dot)com(dot)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

In response to

pgsql-hackers by date

Next:From: xuyifengDate: 2000-11-28 15:15:23
Subject: Re: beta testing version
Previous:From: Tom LaneDate: 2000-11-28 14:49:37
Subject: Re: FWD: tinterval vs interval on pgsql-novice

pgsql-general by date

Next:From: Zeugswetter Andreas SBDate: 2000-11-28 15:30:49
Subject: AW: [HACKERS] Re: is it a bug?
Previous:From: Martin A. MarquesDate: 2000-11-28 14:49:30
Subject: Re: Tuple size limits and upgrading

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group