8.2.1 to_char(negative interval,'HH24:MI') bug? - Mailing list pgsql-novice

From Frank Bax
Subject 8.2.1 to_char(negative interval,'HH24:MI') bug?
Date
Msg-id 5.2.1.1.0.20070128205441.009fa600@pop6.sympatico.ca
Whole thread Raw
Responses Re: 8.2.1 to_char(negative interval,'HH24:MI') bug?  ("Duncan Garland" <duncan.garland@ntlworld.com>)
List pgsql-novice
select age('2007-01-01 03:00','2007-01-01 04:59');
     age
-----------
  -01:59:00
(1 row)

select to_char(age('2007-01-01 03:00','2007-01-01 04:59'),'HH24:MI');
  to_char
---------
  -1:-59
(1 row)


Isn't just one '-' enough?  This leads to a problem here:


select '2007-01-03 06:00'::timestamp + age('2007-01-01 03:00','2007-01-01
04:59');
       ?column?
---------------------
  2007-01-03 04:01:00
(1 row)


select '2007-01-03 06:00'::timestamp + to_char(age('2007-01-01
03:00','2007-01-01 04:59'),'HH24:MI')::interval;
       ?column?
---------------------
  2007-01-03 05:00:00
(1 row)


pgsql-novice by date:

Previous
From: "Duncan Garland"
Date:
Subject: Re: Enable/Disable Trigger per single transaction
Next
From: "Duncan Garland"
Date:
Subject: Re: 8.2.1 to_char(negative interval,'HH24:MI') bug?