Re: [HACKERS] is it a bug?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
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: [HACKERS] is it a bug?
Date: 2000-11-28 14:48:21
Message-ID: 3A23C5B5.1D15C59@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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.

- Thomas

In response to

Browse pgsql-general by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-28 14:49:37 Re: FWD: tinterval vs interval on pgsql-novice
Previous Message Don Baccus 2000-11-28 14:44:21 Re: Question about Oracle compatibility