On Wed, Mar 01, 2006 at 12:59:29PM -0500, Bruce Momjian wrote:
> Good question.  Should we restrict days to 0 - 30 or -30 - 30?  The
> current system does the later:
> 
>       test=> select justify_days('-45 days');
>          justify_days
>       ------------------
>        -1 mons -15 days
>       (1 row)
> 
>       test=> select justify_days('1 month -45 days');
>        justify_days
>       --------------
>        -15 days
>       (1 row)
> 
>       test=> select justify_days('1 month -15 days');
>         justify_days
>       ----------------
>        1 mon -15 days
>       (1 row)
> 
> Should we be adjusting the last one?  I am unsure.  Comments?

ISTM it should be looking at the sign of the overall interval, and
sticking with that consistently. So while '1 mon 5 days' and '-3 mon -8
days' both make sense, '1 mon -2 days' doesn't make nearly as much sense
in the general case. Of course this is complicated by the fact that '1
mon 20 days' doesn't necessarily equate to '2 mon -10 days'... :(

One of these days we should just create a new calendar. ;)
-- 
Jim C. Nasby, Sr. Engineering Consultant      [EMAIL PROTECTED]
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to