padding an integer ...

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: padding an integer ...
Date: 2005-10-26 03:57:25
Message-ID: 20051026005530.E993@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Is there any way of "padding" an integer, similar to how, in perl, I would
do:

printf("%03d", 1);

to get:

001

Specifically, I'm looking to do this in a pl/pgsql function ... like to
avoid moving to pl/php or pl/perl if I can ... but, from what I've been
able to find, I suspect I'm not going to have much of a choice ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Marc G. Fournier 2005-10-26 03:58:13 pl/* overhead ...
Previous Message Tom Lane 2005-10-26 03:53:44 Re: broken join optimization? (8.0)