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

Re: Conversion errors for datetime fields

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Conversion errors for datetime fields
Date: 2000-12-29 02:37:32
Message-ID: 20001228203732.A4160@lerami.lerctr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
* Larry Rosenman <ler(at)lerctr(dot)org> [001228 19:39]:
> * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [001228 11:33]:
> > Larry Rosenman <ler(at)lerctr(dot)org> writes:
> > > Aren't we *REQUIRED* by SQL99 to accept up to :61 to account for 
> > > leap seconds?
> > 
> > 60, maybe --- I have not looked at the SQL spec.  61 is a widely
> > repeated mistake; there never have been and never will be two leap
> > seconds in the same minute (cf. NTP spec, RFC1305, esp. appendix E).
> > But in reality, since we are using Unix-based timekeeping which does not
> > cope with leap seconds, it is pointless to consider :60 as meaning a
> > leap second.  I think it's better to continue to regard it as an error.
> > The only other thing we could do with it is treat 00:00:60 as meaning
> > the same as 00:01:00, which is not really correct behavior.
> Looking at Page 166 of "SQL-99 Complete, Really" by Peter Gulutzan &
> Trudy Peltzer, R&D Books, ISBN 0-87930-568-1, 1st bullet:
> 
>    " First the Standard *REQUIRES* a DBMS to extend the range of
> seconds-field values to ''less than 62'' (rather than ''less than
> 60'') and thus account for up to 2 positive leap seconds. (There is a
> GOTCHA here: leap seconds should always be for the last minute of a
> day as in TIME '23:59:60', but the Standard allows erroneous values
> like TIME '12:34:60'.)" Emphasis on requires is mine. 
> 
> So, here we have the SQL-99 standard requiring the behaviour.  
> 
> So, what do the assembled coders/experts think? 
Oh, and the UnixWare strftime man page allows %s to return 00-61. 

SO, we need to allow it as well.  I suspect the C99 standard or 
some other POSIX/SUS/etc standard changed. 

So, we need to change. 

LER

> 
> Larry
>     
> > 
> > 			regards, tom lane
> -- 
> Larry Rosenman                     http://www.lerctr.org/~ler
> Phone: +1 972-414-9812                 E-Mail: ler(at)lerctr(dot)org
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-12-29 02:44:06
Subject: Re: Conversion errors for datetime fields
Previous:From: Larry RosenmanDate: 2000-12-29 01:39:01
Subject: Re: Conversion errors for datetime fields

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