Incorrect text to timestamp conversion

From: "Derrick Hamner" <derrickh(at)ntiusa(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Incorrect text to timestamp conversion
Date: 2001-11-13 01:02:39
Message-ID: IMEEINNDMCAGEGHDOIKGEECMCBAA.derrickh@ntiusa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Your name : Derrick Hamner
Your email address : derrickh(at)ntiusa(dot)com

System Configuration
---------------------
Architecture (example: Intel Pentium) : AMD Athlon

Operating System (example: Linux 2.0.26 ELF) : Linux 2.4.9

PostgreSQL version (example: PostgreSQL-7.1.3): PostgreSQL-7.1.3,
PostgresSQL-7.1.2

Compiler used (example: gcc 2.95.2) : postgresql-7.1.3-2.i386.rpm from
Red Hat 7.2, postgresql-7.1.2-4PGDG

Please enter a FULL description of your problem:
------------------------------------------------
I believe that I have found a rounding error in the conversion of the text
type returned by timeofday() to timestamp and to timestamp with time zone.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
test=# select 'Mon Nov 12 04:28:59.995001 2001 PDT'::timestamp;
?column?
---------------------------
2001-11-12 03:28:60.00-08
(1 row)

Note the seconds field in the result is 60. This behavior occurs when the
seconds field is 59 and with any fractional second value from 0.995001
through 0.999999. The rest of the string does not seem to influence this
behavior.

Browse pgsql-bugs by date

  From Date Subject
Next Message Doran L. Barton 2001-11-13 08:13:48 Re: 7.1.3 w/ Perl/DBI application hangs
Previous Message Hiroshi Inoue 2001-11-13 00:35:23 Re: Bug #514: Backend crashes periodically