From: Tom Lane <tgl@sss.pgh.pa.us>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16169: Default time output for 24:00 is 00:00
Date: Tue, 17 Dec 2019 16:05:57 -0500
Message-ID: <15853.1576616757@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+bJJbzTvsxDL4rnaPOQqT5HnhUJVH48U9N9XioLNsoY=9Bfig@mail.gmail.com>
References: <20191217181426.GA27596@alvherre.pgsql>
<8219.1576606680@sss.pgh.pa.us>
<CA+bJJbzTvsxDL4rnaPOQqT5HnhUJVH48U9N9XioLNsoY=9Bfig@mail.gmail.com>
Francisco Olarte <folarte@peoplecall.com> writes:
> On Tue, Dec 17, 2019 at 7:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Another theory is that the webpage is passing the output through some
>> type-aware reformatting ... that seems pretty weird though.
> I think it is that. http://sqlfiddle.com/#!17/9eecb/43349 == select
> '24:00'::time::text; returns "24:00:00".
Hmm ... yeah. If you try similar experiments with interval or timestamp
values, or even just booleans, you get completely different results
depending on whether the exposed query result type is that or just text.
For instance
select now();
2019-12-17T20:59:28.701655Z
select now()::text;
2019-12-17 20:59:50.113717+00
There are a few cases where a cast-to-text in PG produces a different
string than the type's output function would, but that doesn't apply
here. sqlfiddle's web page must be coercing the value into some
format they like better.
So that's something sqlfiddle.com really ought to document for
themselves. (Maybe they do --- I've never poked around their
website in any detail.)
regards, tom lane
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: tgl@sss.pgh.pa.us, folarte@peoplecall.com, alvherre@2ndquadrant.com
Subject: Re: BUG #16169: Default time output for 24:00 is 00:00
In-Reply-To: <15853.1576616757@sss.pgh.pa.us>
References: <20191217181426.GA27596@alvherre.pgsql> <8219.1576606680@sss.pgh.pa.us> <CA+bJJbzTvsxDL4rnaPOQqT5HnhUJVH48U9N9XioLNsoY=9Bfig@mail.gmail.com> <15853.1576616757@sss.pgh.pa.us>
* 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