Re: [HACKERS] Incorrect handling of timezones with extract

2013-03-12 Thread Josh Berkus
> The behavior of timestamp-plus-interval is certainly supported by that > argument, but I'm less convinced about timestamp-minus-timestamp. The > raw result of the timestamp subtraction here is 71 hours (not the normal > 72). Perhaps it should be outputting it that way instead of converting > t

Re: [HACKERS] Incorrect handling of timezones with extract

2013-03-12 Thread Tom Lane
Josh Berkus writes: >> and extract(day) from that gives -2 not -3. You could argue that this >> definition of timestamp subtraction isn't too consistent with the >> timestamp-plus-interval operator, and you'd be right; but I doubt we'd >> consider changing it now. > We specifically added that fe

Re: [HACKERS] Incorrect handling of timezones with extract

2013-03-12 Thread Josh Berkus
> and extract(day) from that gives -2 not -3. You could argue that this > definition of timestamp subtraction isn't too consistent with the > timestamp-plus-interval operator, and you'd be right; but I doubt we'd > consider changing it now. We specifically added that feature to support productio

Re: [HACKERS] Incorrect handling of timezones with extract

2013-03-12 Thread Tom Lane
Michael Paquier writes: > On Tue, Mar 12, 2013 at 3:11 PM, Michael Paquier > wrote: >> postgres=# select extract(day from ((CAST(-3 || 'day' as interval)+now()) >> - now())); >> date_part >> --- >> -2 >> (1 row) >> Here I believe that the correct result should be -3. > Sorry for the nois

Re: [HACKERS] Incorrect handling of timezones with extract

2013-03-12 Thread Michael Paquier
On Tue, Mar 12, 2013 at 3:11 PM, Michael Paquier wrote: > postgres=# select extract(day from ((CAST(-3 || 'day' as interval)+now()) > - now())); > date_part > --- > -2 > (1 row) > Here I believe that the correct result should be -3. > Note that it passes with values upper than -2