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

AW: [HACKERS] is it a bug?

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Thomas Lockhart'" <lockhart(at)alumni(dot)caltech(dot)edu>, He weiping <laser(at)zhengmai(dot)com(dot)cn>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: AW: [HACKERS] is it a bug?
Date: 2000-11-28 14:40:15
Message-ID: 11C1E6749A55D411A9670001FA68796336814D@sdexcsrv1.f000.d0188.sd.spardat.at (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
> > ... it seems the "lpad", "rpad" don't work,
> > when I type:
> > select lpad('laser', 4, 'a');
> > in psql, the result is still
> > 'laser', the same with 'rpad',
> > Is it a bug or I'm mis-understaning the lpad and/or rpad functions?
> 
> A simple misunderstanding. The length argument is for the *total*
> length. So padding a 5 character string to a length of 4 will do
> nothing. But padding to a length of 6 will add a single "a" to the
> string.

Seems the implementor made a mistake, since this is supposed to be oracle 
compat stuff it should behave like Oracle, and thus trim the string to 4 chars.

Andreas 

pgsql-hackers by date

Next:From: Don BaccusDate: 2000-11-28 14:41:53
Subject: RE: Full text Indexing -out of contrib and into main..
Previous:From: Don BaccusDate: 2000-11-28 14:37:52
Subject: Re: beta testing version

pgsql-general by date

Next:From: Thomas LockhartDate: 2000-11-28 14:48:21
Subject: Re: [HACKERS] is it a bug?
Previous:From: Gordan BobicDate: 2000-11-28 13:56:11
Subject: Re: Tuple size limits and upgrading

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