Thread: Bug in select to_char(now(), 'YYYY/MM/DD HH24:MI:SS:MS')

Bug in select to_char(now(), 'YYYY/MM/DD HH24:MI:SS:MS')

From
Pierre Le Mouëllic
Date:
Hi,

Sometimes, when we run the SQL request :

select to_char(now(), 'YYYY/MM/DD HH24:MI:SS:MS')

we've got the result :

2008/06/11 15:01:06:1000

instead of :

2008/06/11 15:01:07:000


Our version of postgres is PostgreSQL 8.2.6 64-bit on
i386-pc-solaris2.10, compiled by /ws/on10-tools/SUNWspro/SS11/bin/cc -Xa

Thanks for your prompt answer.

Pierre Le Mouëllic


Re: Bug in select to_char(now(), 'YYYY/MM/DD HH24:MI:SS:MS')

From
Tom Lane
Date:
Pierre Le Mouëllic <pierre.lemouellic@xgs-france.com> writes:
> Sometimes, when we run the SQL request :
> select to_char(now(), 'YYYY/MM/DD HH24:MI:SS:MS')
> we've got the result :
> 2008/06/11 15:01:06:1000

This is fixed in 8.3 and up:
http://archives.postgresql.org/pgsql-committers/2007-02/msg00334.php

It was not back-patched because it could change the behavior in cases
that weren't clearly errors.
        regards, tom lane