Re: padding an integer ...

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: padding an integer ...
Date: 2005-10-26 04:11:37
Message-ID: 20051026041137.GA18613@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Oct 26, 2005 at 12:57:25AM -0300, Marc G. Fournier wrote:
> Is there any way of "padding" an integer, similar to how, in perl, I would
> do:
>
> printf("%03d", 1);
>
> to get:
>
> 001

test=> SELECT to_char(1, '000');
to_char
---------
001
(1 row)

http://www.postgresql.org/docs/8.0/interactive/functions-formatting.html

--
Michael Fuhr

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2005-10-26 04:45:17 why vacuum
Previous Message Marc G. Fournier 2005-10-26 03:58:13 pl/* overhead ...