Return value error of‘to_timestamp’

From: 甄明洋 <zhenmingyang(at)yeah(dot)net>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Return value error of‘to_timestamp’
Date: 2016-08-04 04:51:25
Message-ID: 379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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=#

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message digoal 2016-08-04 07:58:08 BUG #14277: when define USE_NAMED_POSIX_SEMAPHORES , make error
Previous Message petr.mrazek 2016-08-03 13:38:05 BUG #14276: Slony package has bad path to PID file folder in starts script