PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15698
PG Version10.5
OSWindows 10
Opened2019-03-16 20:11:19+00
Reported byS├ębastien Celles
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15698
Logged by:          S├ębastien Celles
Email address:      (redacted)
PostgreSQL version: 10.5
Operating system:   Windows 10
Description:        

Hello,

This is my first bug report here (despite I'm using PostgreSQL since many
years !)

I don't know if it's a bug... but the following query

    SELECT to_char(-(3 * 60 * 60 * 1000 + 7*60 * 1000 + 12345) * INTERVAL '1
millisecond', 'HH24:MI:SS.MS') as interv;

doesn't return the result I was expecting.

It returns:

    '-03:-07:-12.-345'

I was expecting

    '-03:07:12.345'

If it's not a bug (but a feature ;-) )... is there a way to return result as
I was expecting.

Kind regards

Messages

DateAuthorSubject
2019-03-16 20:11:19+00PG Bug reporting formBUG #15698: to_char doesn't return expected value with negative INTERVAL
2019-04-09 17:23:22+00Bruce MomjianRe: BUG #15698: to_char doesn't return expected value with negative INTERVAL
2019-04-09 18:21:13+00"s(dot)celles(at)gmail(dot)com"Re: BUG #15698: to_char doesn't return expected value with negative INTERVAL