Michael Glaesemann <[EMAIL PROTECTED]> writes:
> I've started working on this change, and one difference has shown up  
> immediately in the regression tests. v8.0.3 currently returns:

>    SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
>                9 years...
>    ----------------------------------
> !  9 years 1 mon -11 days -10:46:00
>    (1 row)

> With my first round of changes,

>    SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
>                9 years...
>    ----------------------------------
> !  9 years 1 mon -12 days +13:14:00
>    (1 row)

Right, because it is now possible for day and hour to have different signs.
Comes with the territory I think.

> These are equivalent in both CVS and my branch, as '1 day'::interval  
> = '24 hours'::interval. I haven't checked the SQL spec yet (and  
> intend to do so), but is there a canonical form for intervals that we  
> need to return?

AFAICS, the spec only allows one sign for the entire interval value,
so this behavior is already outside the spec.  As long as we don't
generate different field signs in cases where that was not already
present in the input, I don't think it's a spec violation.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to