From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: s.celles@gmail.com
Subject: BUG #15698: to_char doesn't return expected value with negative INTERVAL
Date: Sat, 16 Mar 2019 20:11:19 +0000
Message-ID: <15698-73406d98ae47f2af@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15698
Logged by: Sébastien Celles
Email address: s.celles@gmail.com
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, s.celles@gmail.com
Subject: Re: BUG #15698: to_char doesn't return expected value with negative INTERVAL
In-Reply-To: <15698-73406d98ae47f2af@postgresql.org>
References: <15698-73406d98ae47f2af@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox