Received: from alcatel.no (ns2.alcatel.no [193.213.238.2]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g037eim71664 for ; Thu, 3 Jan 2002 02:40:45 -0500 (EST) (envelope-from rolf.ostvik@axxessit.no) Received: from axitonts20a.axxessit.no ([155.4.46.5]) by alcatel.no (8.9.3/8.9.3/Alcanet1.0) with ESMTP id IAA21362 for ; Thu, 3 Jan 2002 08:40:43 +0100 From: rolf.ostvik@axxessit.no Subject: Re: to_char adds leading space, intended? To: pgsql-sql@postgresql.org X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: Date: Thu, 3 Jan 2002 08:39:40 +0100 X-MIMETrack: Serialize by Router on NotesOslo/AxxessIT(Release 5.0.8 |June 18, 2001) at 03.01.2002 08:39:42 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id g037jWn72953 X-Archive-Number: 200201/4 X-Sequence-Number: 6095 On 2002-01-03 "Aasmund Midttun Godal" wrote: >envisity=# SELECT '''' || to_char(1234, '099999') || ''''; > ?column? >----------- > ' 001234' >(1 row) Modifier "FM" in the format string is your friend SELECT '''' || to_char(1234, 'FM099999') || ''''; ^^ Table 4.11 on http://www.postgresql.org/idocs/index.php?functions-formatting.html -- AXXESSIT ASA http://www.axxessit.no Rolf Østvik / Test technician Phone : (+47) 69 17 38 19 Fax: (+47) 69 17 39 00 P.O. Box 1053, Isebakkevn. 25, N-1787 Berg i Østfold