to_char adds leading space, intended?

From: "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: to_char adds leading space, intended?
Date: 2002-01-03 04:31:29
Message-ID: 20020103043129.20231.qmail@213-145-170-138.dd.nextgentel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

envisity=# SELECT '''' || to_char(1234, '099999') || '''';
?column?
-----------
' 001234'
(1 row)

Is this the way it's meant to be?

I would prefer
'001234'

So I don't have to ltrim it.
Aasmund Midttun Godal

aasmund(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46

Browse pgsql-sql by date

  From Date Subject
Next Message Karl Raven 2002-01-03 05:00:44 change null to 0 in SQL script
Previous Message Tom Lane 2002-01-02 22:10:29 Re: [SQL] Unpredictable text -> date implicit casting behaviour/to_date bug