one-off error in to_char formatting

Started by Erik Rijkersalmost 16 years ago2 messages
#1Erik Rijkers
er@xs4all.nl

ISTM this is a bug, no?

(9.0devel, cvs 2010.03.04 01:30)

replicas=# select length( to_char(1, '0') );
length
--------
2
(1 row)

There seems to be an erroneously prefixed space:

replicas=# select '>' || to_char(1, repeat('0',8)) || '<';
?column?
-------------

00000001<

(1 row)

replicas=# select version();
version
--------------------------------------------------------------------------------------------------
PostgreSQL 9.0devel-standby on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.3, 64-bit
(1 row)

Erik Rijkers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Erik Rijkers (#1)
Re: one-off error in to_char formatting

"Erik Rijkers" <er@xs4all.nl> writes:

There seems to be an erroneously prefixed space:

No, that's where the sign goes. You can suppress it with FM,
if you don't want fixed-width output.

regards, tom lane