Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2007-04-02 Thread Bruce Momjian
Added to TODO: o Have timestamp subtraction not call justify_hours()? http://archives.postgresql.org/pgsql-sql/2006-10/msg00059.php --- Jim C. Nasby wrote: > Yes, but if it was '2004-01-02 01:00:00'-'200

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2007-03-26 Thread Bruce Momjian
Do we want to do anything about this for 8.3? --- Jim C. Nasby wrote: > Yes, but if it was '2004-01-02 01:00:00'-'2004-01-01 00:00:00' it should > return 25:00:00, not 1 day 1:00. > > I agree with Tom that this should be ch

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2007-02-23 Thread Jim C. Nasby
Yes, but if it was '2004-01-02 01:00:00'-'2004-01-01 00:00:00' it should return 25:00:00, not 1 day 1:00. I agree with Tom that this should be changed; I'm just arguing that we might well need a backwards-compatibility solution for a while. At the very least we'd need to make this change very clea

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2007-02-20 Thread Bruce Momjian
One problem with removing justify_hours() is that this is going to return '24:00:00', rather than '1 day: test=> select '2004-01-02 00:00:00'::timestamptz - '2004-01-01 00:00:00'::timestamptz; ?column? -- 24:00:00 (1 row)

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Josh Berkus
Jim, > I agree in general, except most languages have terrible support for > time/date data, so I can see a much bigger case for the database being > able to do it (and it's not like we'll be removing justify_*). Be that > as it may, there are probably apps out there that will break if this is >

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Jim C. Nasby
On Mon, Oct 09, 2006 at 02:57:28PM -0500, Aaron Bono wrote: > On 10/5/06, Jim Nasby <[EMAIL PROTECTED]> wrote: > > > >On Oct 5, 2006, at 11:50 AM, Tom Lane wrote: > >> regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01 > >> 09:30:41'::timestamp); > >> ?column? > >> ---

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Aaron Bono
On 10/5/06, Jim Nasby <[EMAIL PROTECTED]> wrote: On Oct 5, 2006, at 11:50 AM, Tom Lane wrote:> regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01> 09:30:41'::timestamp);>  ?column?> -->  14 days 14:28:19 > (1 row)>> should be reporting '350:28:19' instead.>> Thi

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals

2006-10-06 Thread Graham Davis
Great, it's nice to see that this might get rolled into one of the next releases. Thanks, Graham. Tom Lane wrote: Michael Glaesemann <[EMAIL PROTECTED]> writes: Considering how late it is in the cycle, perhaps the change in behavior should come in 8.3. Yeah, there's not really e

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-05 Thread Jim Nasby
On Oct 5, 2006, at 11:50 AM, Tom Lane wrote: regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01 09:30:41'::timestamp); ?column? -- 14 days 14:28:19 (1 row) should be reporting '350:28:19' instead. This is a hack that was done to minimize the changes in t

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-05 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > Considering how late it is in the cycle, perhaps the change in > behavior should come in 8.3. Yeah, there's not really enough time to think through the consequences now. I'd like to experiment with it for 8.3 though. rega

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-05 Thread Michael Glaesemann
On Oct 6, 2006, at 1:50 , Tom Lane wrote: I'm tempted to propose that we remove the justify_hours call, and tell anyone who really wants the old results to apply justify_hours() to the subtraction result for themselves. Not sure what the fallout would be, though. I'm tempted to support

[HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-05 Thread Tom Lane
Graham Davis <[EMAIL PROTECTED]> writes: > The documentation for to_char states that: > "|to_char(interval)| formats HH and HH12 as hours in a single day, while > HH24 can output hours exceeding a single day, e.g. >24." > However I can not get it to work with time intervals that span more than