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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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...

Browse pgsql-bugs by date

  From Date Subject
Next Message David Godin 1999-09-20 18:59:55 Installing PostgreSQL
Previous Message David Sauer 1999-09-14 19:54:20 problem with unique entry