Re: Question about Postgresql time fields(possible bug) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Question about Postgresql time fields(possible bug)
Date
Msg-id 4050.1136927537@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question about Postgresql time fields(possible bug)  (Dave Page <dpage@vale-housing.co.uk>)
List pgsql-hackers
Dave Page <dpage@vale-housing.co.uk> writes:
> That's not really the point. The ISO 8601 standard allows midnight to be
> expressed as 00:00:00 or 24:00:00 to enable you to tell which midnight is
> being referred to (ie. The beginning or the end of the day).

There are other reasons for allowing it that have nothing to do with
that, either.  IIRC the argument that carried the day involved roundoff
behavior.  In 8.0 and before you can do this:

regression=# select '23:59:59.99'::time(0);  time
----------24:00:00
(1 row)

If you disallow 24:00:00 then there are legal values of time(n) that
will fail to round off to time(0).  What's worse, data that was accepted
and rounded off by prior releases will fail to reload after a dump.  It
was a complaint from a user who got burnt by that behavior that got us
thinking about it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Question about Postgresql time fields(possible bug)
Next
From: Greg Stark
Date:
Subject: Re: Improving N-Distinct estimation by ANALYZE