Re: to_char adds leading space, intended? - Mailing list pgsql-sql

From rolf.ostvik@axxessit.no
Subject Re: to_char adds leading space, intended?
Date
Msg-id OF36E25CE3.8C3DF18B-ONC1256B36.00291D75@axxessit.no
Whole thread Raw
In response to to_char adds leading space, intended?  ("Aasmund Midttun Godal" <postgresql@envisity.com>)
List pgsql-sql
On 2002-01-03 "Aasmund Midttun Godal" <postgresql@envisity.com> 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




pgsql-sql by date:

Previous
From: "Aasmund Midttun Godal"
Date:
Subject: to_char adds leading space, intended?
Next
From: Roland Roberts
Date:
Subject: Working with array value columns in PL/pgSQL triggers/functions