AW: is it a bug? - Mailing list pgsql-hackers

From Zeugswetter Andreas SB
Subject AW: is it a bug?
Date
Msg-id 11C1E6749A55D411A9670001FA68796336814D@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
List pgsql-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:

Previous
From: Thomas Lockhart
Date:
Subject: Re: is it a bug?
Next
From: Tom Lane
Date:
Subject: Re: FWD: tinterval vs interval on pgsql-novice