X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EC56ED6EDE for ; Wed, 26 Oct 2005 00:57:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34759-05 for ; Wed, 26 Oct 2005 03:57:28 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 120E5D6E9F for ; Wed, 26 Oct 2005 00:57:29 -0300 (ADT) Received: from localhost (av.hub.org [200.46.204.144]) by hub.org (Postfix) with ESMTP id 36B1E64B83C for ; Wed, 26 Oct 2005 00:57:29 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33232-08 for ; Wed, 26 Oct 2005 03:57:26 +0000 (GMT) Received: from ganymede.hub.org (blk-222-82-85.eastlink.ca [24.222.82.85]) by hub.org (Postfix) with ESMTP id C066964B815 for ; Wed, 26 Oct 2005 00:57:26 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 6250539167; Wed, 26 Oct 2005 00:57:25 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 615DA369CF for ; Wed, 26 Oct 2005 00:57:25 -0300 (ADT) Date: Wed, 26 Oct 2005 00:57:25 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: pgsql-sql@postgresql.org Subject: padding an integer ... Message-ID: <20051026005530.E993@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.329 required=5 tests=[AWL=0.279, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/302 X-Sequence-Number: 23155 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@hub.org Yahoo!: yscrappy ICQ: 7615664