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

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: (view raw, whole thread or download thread mbox)
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,

  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;
 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

pgsql-bugs by date

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

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