pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 甄明洋 <zhenmingyang@yeah.net>
To: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Return value error of‘to_timestamp’ 
Date: Thu, 4 Aug 2016 12:51:25 +0800 (CST)
Message-ID: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

When the fractional seconds more than 6, the return value of to_timestamp without truncation.
Postgres think the total value of the.123456789 as a fractional second part and convert to microsecond stored in database.
 example:
postgres=# select to_timestamp('1990-1-1 11:11:11.123456789', 'YYYY-MM-DD HH24:MI:SS.US');
         to_timestamp
-------------------------------
 1990-01-01 11:13:14.456789+08
(1 row)
postgres=#



view thread (10+ messages)  latest in thread

Message-ID: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net>
Permalink:  ../379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net/
Also on:    postgresql.org/message-id/379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net

 · 

reply

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: zhenmingyang@yeah.net
  Subject: Re: Return value error of‘to_timestamp’
  In-Reply-To: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net>
  References: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net>

* 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