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

Re: BUG #1180: incorrect date handling

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ben Bidner <vort(at)wiretapped(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1180: incorrect date handling
Date: 2004-06-23 04:21:16
Message-ID: 20040622212001.N37595@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Tue, 22 Jun 2004, Tom Lane wrote:

> "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> > PostgreSQL version: 7.3.2
>
> > colony=# insert into foo values ('2003-12-11 23:59:60.00');
> > ERROR:  Bad timestamp external representation '2003-12-11 23:59:60.00'
>
> Use a more recent PG version ... we have fixed a thing or two since
> 7.3 (in fact 7.3.3 and later versions take this, if I read the CVS logs
> aright).
>
> > under 7.4.2, (had a friend test it out) inserting a timestamp with a time of
> > 23:59:60.00 is allowed, it just increments the day and sets the time to
> > 00:00:00 (as one would expect). However it still allows you to insert the
> > time as `23:59:59.9999999` and it updates the time (incorrectly) to
> > `23:59:60.00` instead of incrementing the day and setting the time to
> > 00:00:00 (since 23:59:60 is .. or should be invalid).
>
> Horsepucky.
>
> regression=# select version();
>                             version
> ---------------------------------------------------------------
>  PostgreSQL 7.4.3 on hppa-hp-hpux10.20, compiled by GCC 2.95.3
> (1 row)
>
> regression=# select '2003-12-11 23:59:60.00'::timestamp;
>       timestamp
> ---------------------
>  2003-12-12 00:00:00
> (1 row)

That's not the case he was complaining about for 7.4 though, it was this
case I think (done on my 7.5 system, but...):

sszabo=# select timestamp '2003-12-11 23:59:59.9999999';
       timestamp
------------------------
 2003-12-11 23:59:60.00
(1 row)

sszabo=# select version();
                                                  version
------------------------------------------------------------------------------------------------------------
 PostgreSQL 7.5devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2
20020903 (Red Hat Linux 8.0 3.2-7)
(1 row)


In response to

pgsql-bugs by date

Next:From: Martin PittDate: 2004-06-23 08:29:55
Subject: Fwd: Bug#253295: postgresql: VACUUM FULL produce warnings
Previous:From: Tom LaneDate: 2004-06-23 03:25:41
Subject: Re: BUG #1180: incorrect date handling

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