Re: [BUGS] BUG #3761: Problems with to_char(timestamp) and milliseconds

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jose Tomas Eterovic <roleroz(at)gmail(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #3761: Problems with to_char(timestamp) and milliseconds
Date: 2007-11-19 21:29:47
Message-ID: 200711192129.lAJLTlk09111@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Jose Tomas Eterovic wrote:
>
> The following bug has been logged online:
>
> Bug reference: 3761
> Logged by: Jose Tomas Eterovic
> Email address: roleroz(at)gmail(dot)com
> PostgreSQL version: 8.2.4-r1
> Operating system: Gentoo Linux
> Description: Problems with to_char(timestamp) and milliseconds
> Details:
>
> When you use to_char to show as a string a date (including milliseconds),
> there's the possibility that the number of milliseconds will be 1000 (not
> between 000-999 as the documentation says)
>
> if you have a table (called "testTable") with a single column of type
> "timestamp" (called "testTimestamp") with lots of data, and you run the
> query
>
> SELECT to_char(testTimestamp, 'YYYY-MM-DD HH24:MI:SS.MS') FROM testTable
>
> you'll eventually get a result like
> 2007-10-24 13:44:48.1000
> instead of
> 2007-10-24 13:44:49.000

This is fixed in 8.3 beta with this attached patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 2.1 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-11-19 23:38:51 Re: BUG #3760: Comment on restore database
Previous Message Simon Riggs 2007-11-19 20:02:24 Re: BUG #3760: Comment on restore database

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-11-20 02:31:06 Re: [HACKERS] fulltext parser strange behave
Previous Message Jose Tomas Eterovic 2007-11-19 19:30:28 BUG #3761: Problems with to_char(timestamp) and milliseconds