Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4kvU-0003YV-KJ for pgsql-interfaces@arkaria.postgresql.org; Sat, 17 Jul 2021 14:04:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4kvS-00063U-RM for pgsql-interfaces@arkaria.postgresql.org; Sat, 17 Jul 2021 14:04:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4kvS-0005zb-L8 for pgsql-interfaces@lists.postgresql.org; Sat, 17 Jul 2021 14:04:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4kvO-0003H3-Nb for pgsql-interfaces@postgresql.org; Sat, 17 Jul 2021 14:04:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16HE4BxL056085; Sat, 17 Jul 2021 10:04:12 -0400 From: Tom Lane To: "Luiz E. P. Fernandes" cc: pgsql-interfaces@postgresql.org Subject: Re: Seconds precision in timestamp columns In-reply-to: <187cc78d-fc34-aaa9-aeb0-f0045b9b4ce8@uol.com.br> References: <187cc78d-fc34-aaa9-aeb0-f0045b9b4ce8@uol.com.br> Comments: In-reply-to "Luiz E. P. Fernandes" message dated "Fri, 16 Jul 2021 16:03:53 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <56083.1626530651.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 17 Jul 2021 10:04:11 -0400 Message-ID: <56084.1626530651@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Luiz E. P. Fernandes" writes: > In the dvdrental example database, there is a column named > 'payment_date' on the 'payment' table and columns 'rental_date' and > 'return_date' on the 'rental' table.  These columns appear on the > information_schema.columns view with identical specifications: datatype > = 'timestamp without timezone', datetime_precision = 6. However, a > select on table 'payment' presents column 'payment_date' with 6 > fractional digits, while a select on table 'rental' presents columns > 'rental_date' and 'return_date' without fractional digits. Presumably this is just an artifact of the example data. timestamptz_out suppresses trailing fractional zeroes, regardless of the column's nominal precision. So there's no reason to think that one column is being treated differently from the others. regards, tom lane