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 1m4hy8-000854-Cq for pgsql-interfaces@arkaria.postgresql.org; Sat, 17 Jul 2021 10:54:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4hy6-0000ZU-KH for pgsql-interfaces@arkaria.postgresql.org; Sat, 17 Jul 2021 10:54:50 +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 1m4T7T-00038k-1b for pgsql-interfaces@lists.postgresql.org; Fri, 16 Jul 2021 19:03:31 +0000 Received: from a2-socom6-1.uol.com.br ([200.147.34.37] helo=smtps.uol.com.br) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4T7O-0002v2-L8 for pgsql-interfaces@postgresql.org; Fri, 16 Jul 2021 19:03:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by a2-socom6.uol.com.br (Postfix) with ESMTP id 2CCD2C000057 for ; Fri, 16 Jul 2021 16:03:22 -0300 (-03) X-UOL-SMTP: SMTPS587 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uol.com.br; s=ubz; t=1626462201; bh=QMtWx98hlXErGG5rh2h06KERuaX4yKK+ENPqpL7edMU=; h=To:From:Subject:Date; b=fdGvorTbKT/dAwVlg+7lg84jOrDB7rrmZsCzIIip366gdCMo2ywe9ukSDcOtHispL TW6vRt2Ps/7O9xoDdCJ7GS9UUADQ0BU/Htb8NKIKfYXd4yzgXcBO5u2aI1I9DBAV/r yfFvGKZo65g/LATgk92NwNHvdnEZQVxLzdYMmpCA= Received: from [192.168.1.70] (unknown [189.15.233.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: lepfer@uol.com.br) by a2-socom6.uol.com.br (Postfix) with ESMTPSA id B19C1C000056 for ; Fri, 16 Jul 2021 16:03:19 -0300 (-03) To: pgsql-interfaces@postgresql.org From: "Luiz E. P. Fernandes" Subject: Seconds precision in timestamp columns Message-ID: <187cc78d-fc34-aaa9-aeb0-f0045b9b4ce8@uol.com.br> Date: Fri, 16 Jul 2021 16:03:53 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-VADE-SPAMSTATE: clean X-VADE-SPAMSCORE: 0 X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefgdduudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecufgfqnfdqrfetkfffpdcuqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefvhffukffffgggtgfgsehtkeertddtfeejnecuhfhrohhmpedfnfhuihiiucfgrdcurfdrucfhvghrnhgrnhguvghsfdcuoehlvghpfhgvrhesuhholhdrtghomhdrsghrqeenucggtffrrghtthgvrhhnpedufeefveegfefhkeeihfdtveduudfhgedthfefjedtteefvedvteevgeeljeelgeenucfkphepudekledrudehrddvfeefrddufeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudekledrudehrddvfeefrddufeegpdhhvghloheplgduledvrdduieekrddurdejtdgnpdhmrghilhhfrhhomhepfdfnuhhiiicugfdrucfrrdcuhfgvrhhnrghnuggvshdfuceolhgvphhfvghrsehuohhlrdgtohhmrdgsrheqpdhrtghpthhtohepphhgshhqlhdqihhnthgvrhhfrggtvghssehpohhsthhgrhgvshhqlhdrohhrgh X-SIG5: cca2568e966e6489c9b2a57e27ae018c List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, 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. select payment_date from payment limit 1; --> for example, payment_date: '2007-02-15 22:25:46.996577' select rental_date, return_date from rental limit 1; --> for example, rental_date: '2005-05-24 22:54:33' This happens in PgAdmin and also in the query values returned by PQgetvalue(), with LibPq. What defines this seconds precision?  Is it possible to find the number of fractional digits that will be returned in a datetime column, before calling PQgetvalue()? Thanks in advance. Luiz Fernandes