Re: Question about Postgresql time fields(possible bug)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Cc: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about Postgresql time fields(possible bug)
Date: 2006-01-10 21:12:17
Message-ID: 4050.1136927537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Dave Page <dpage(at)vale-housing(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2006-01-10 21:14:31 Re: Question about Postgresql time fields(possible bug)
Previous Message Dave Page 2006-01-10 20:51:49 Re: Question about Postgresql time fields(possible bug)

Browse pgsql-patches by date

  From Date Subject
Next Message Josh Berkus 2006-01-10 21:14:31 Re: Question about Postgresql time fields(possible bug)
Previous Message Dave Page 2006-01-10 20:51:49 Re: Question about Postgresql time fields(possible bug)