From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Michael Glaesemann <grzm(at)myrealbox(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: interval->day first cut |
Date: | 2005-06-14 16:58:30 |
Message-ID: | 200506140958.30328.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Michael,
> I've completed my first cut of adding a day field to the interval
> struct and patched up the regression tests for places where it failed
> due to the new behavior (e.g., interval '19:00' + interval '6:00' =
> interval '25:00'). I haven't added any regression tests for the DST
> behavior, but it works (and this could be the start of the regression
> tests). Note: DST changed on 2005-04-03:
This looks good so far. I could have really used this for 2 calendar
applicaitons, and *will* use it for my next one. This is exactly the kind of
behavior that calendar applications need.
> One interesting fallout of this is that adding two SQL-compliant
> intervals can produce non-SQL-compliant output:
>
> test=# select interval '3 days 16:39' + interval '1 day 15:32' as
> "interesting";
> interesting
> -----------------
> 4 days 32:11:00
I personally don't have a problem with this if the my/dw/hms split is fully
documented. Does it put is in violation of the SQL spec, though? If so, do
we care?
Anyone know how Oracle/DB2 handles this? ( I know how MSSQL handles it --
badly.)
> I've added a interval_simplify function which assumes 1 day = 24
> hours and puts the interval in SQL-spec form. This could be exposed
> to let people "reduce" their intervals. However, I'm concerned this
> is surprising behavior.
Yes, well, we'll have to document it prominently in the release notes and
elsewhere.
--
Josh Berkus
Aglio Database Solutions
San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2005-06-14 17:03:07 | Re: User Quota Implementation |
Previous Message | Josh Berkus | 2005-06-14 16:50:54 | Re: User Quota Implementation |