Re: [SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-07 Thread Karel Zak
On Mon, Jun 07, 2004 at 11:08:37AM +0200, Stefan Weiss wrote: > On Monday, 07 June 2004 09:52, Karel Zak wrote: > > http://www.postgresql.org/docs/7.4/static/functions-formatting.html > > > > Warning: to_char(interval, text) is deprecated and should not be > >

Re: [SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-07 Thread Stefan Weiss
On Monday, 07 June 2004 09:52, Karel Zak wrote: > http://www.postgresql.org/docs/7.4/static/functions-formatting.html > > Warning: to_char(interval, text) is deprecated and should not be > used in newly-written code. It will be removed in the next version. This is news for me. Are there any

Re: [SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-07 Thread Karel Zak
On Sun, Jun 06, 2004 at 06:40:56PM -0400, Tom Lane wrote: > Jeff Boes <[EMAIL PROTECTED]> writes: > > This seems ... well, counter-intuitive at least: > > (using Pg 7.4.1) > > > # select to_char('4 minutes'::interval - > > '5 minutes 30 seconds'::interval, 'mi:ss'); > > > to_char > > -

Re: [SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-06 Thread Tom Lane
Jeff Boes <[EMAIL PROTECTED]> writes: > This seems ... well, counter-intuitive at least: > (using Pg 7.4.1) > # select to_char('4 minutes'::interval - > '5 minutes 30 seconds'::interval, 'mi:ss'); > to_char > - > -1:-3 > (1 row) > Why is the trailing zero lost? Why are there two minu

[SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-06 Thread Jeff Boes
This seems ... well, counter-intuitive at least: (using Pg 7.4.1) # select to_char('4 minutes'::interval - '5 minutes 30 seconds'::interval, 'mi:ss'); to_char - -1:-3 (1 row) Why is the trailing zero lost? Why are there two minus signs? I would expect '-1:30'. Likewise, # select to_char('