Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihK2g-0002Pu-Pa for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2019 21:06:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihK2f-0004n8-0C for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2019 21:06:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihK2e-0004n0-OF for pgsql-bugs@lists.postgresql.org; Tue, 17 Dec 2019 21:06:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ihK2b-0005yJ-NW for pgsql-bugs@lists.postgresql.org; Tue, 17 Dec 2019 21:06:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBHL5vGt015854; Tue, 17 Dec 2019 16:05:58 -0500 From: Tom Lane To: Francisco Olarte cc: Alvaro Herrera , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16169: Default time output for 24:00 is 00:00 In-reply-to: References: <20191217181426.GA27596@alvherre.pgsql> <8219.1576606680@sss.pgh.pa.us> Comments: In-reply-to Francisco Olarte message dated "Tue, 17 Dec 2019 19:29:21 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15852.1576616757.1@sss.pgh.pa.us> Date: Tue, 17 Dec 2019 16:05:57 -0500 Message-ID: <15853.1576616757@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Francisco Olarte writes: > On Tue, Dec 17, 2019 at 7:18 PM Tom Lane 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