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

datetime bug in 6.6.0

From: George Young <gry(at)ll(dot)mit(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: datetime bug in 6.6.0
Date: 1999-09-20 18:42:05
Message-ID: 199909201839.OAA02052@ll.mit.edu (view raw or flat)
Thread:
Lists: pgsql-bugs
Your name		:	george young
Your email address	:	gry(at)ll(dot)mit(dot)edu


System Configuration
---------------------
  Architecture (example: Intel Pentium)  	:pentium(quad xeon actually)

  Operating System (example: Linux 2.0.26 ELF) 	:linux  2.2.11 (SuSE 6.1)

  PostgreSQL version (example: PostgreSQL-6.5.1):PostgreSQL-6.6

  Compiler used (example:  gcc 2.8.0)		: gcc version 2.95.1 19990816 (release)


Please enter a FULL description of your problem:
------------------------------------------------
If a datetime value is inserted with zero seconds, it is displayed
with '60' seconds, and minutes just as entered.  Aside from being incorrect
on it's face, this prevents dumping and restoring, since a seconds value of 60
is invalid for input.

The problem happens with iso style dates as well as the default, shown below.



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
----------------------------------------------------------------------
psql pig2a
[PostgreSQL 6.6.0 on i686-pc-linux-gnu, compiled by gcc 2.95.1]
pig2a=> create table foo(d datetime);
CREATE
pig2a=> insert into foo values('1999-jan-23 8:02:00');
INSERT 237044 1
pig2a=> select * from foo; 
d                              
-------------------------------
Sat Jan 23 08:02:60.00 1999 EST
(1 row)

select datetime_part('millisecond',d) from foo;
datetime_part
-------------
         1000
(1 row)

pig2a=> insert into foo values('1999-jan-23 8:02:60');
ERROR:  Bad datetime external representation '1999-jan-23 8:02:60'

pig2a=> show datestyle;
NOTICE:  DateStyle is Postgres with US (NonEuropean) conventions





If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
Sorry...

pgsql-bugs by date

Next:From: David GodinDate: 1999-09-20 18:59:55
Subject: Installing PostgreSQL
Previous:From: David SauerDate: 1999-09-14 19:54:20
Subject: problem with unique entry

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