Incorrect text to timestamp conversion - Mailing list pgsql-bugs

From Derrick Hamner
Subject Incorrect text to timestamp conversion
Date
Msg-id IMEEINNDMCAGEGHDOIKGEECMCBAA.derrickh@ntiusa.com
Whole thread Raw
List pgsql-bugs
Your name            :    Derrick Hamner
Your email address    :    derrickh@ntiusa.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.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.1.3 w/ Perl/DBI application hangs
Next
From: "¹ÚºÎ½Ä"
Date:
Subject: run-time error!