Skip site navigation (1) Skip section navigation (2)

BUG #3237: function to_char() returns wrong value

From: "Robert wang" <robert(dot)wang(at)eitec(dot)com(dot)tw>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3237: function to_char() returns wrong value
Date: 2007-04-18 03:10:41
Message-ID: 200704180310.l3I3AfAg043638@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3237
Logged by:          Robert wang
Email address:      robert(dot)wang(at)eitec(dot)com(dot)tw
PostgreSQL version: 8.2
Operating system:   Windows 2000 professional
Description:        function to_char() returns wrong value
Details: 

I run this following SQL command in pgAdminIII:

Select to_char(12345,'00000')

but it always returns ' 12345' (hex code: 20 31 32 33 34 35).It always adds
one space char in the left side.

I have to use another function substring() as followings to get my expected
value.  

Select substring(to_char(12345,'00000'),from ' ' for 5)

it exactly returns '12345' which I expect.

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-04-18 05:24:46
Subject: Re: BUG #3235: Partitioning has problem with timestamp and timestamptz data types
Previous:From: Christian GonzalezDate: 2007-04-17 22:57:12
Subject: BUG #3236: Partitioning has problem with timestamp and timestamptz data type

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group