Commit 26ab25b7 by Sven Klemm Committed by Daniel Lee

dont loose subsecond precision when dealing with timestamp or (#9851)

timestamptz
parent 014f6d5a
......@@ -187,7 +187,7 @@ func (e PostgresQueryEndpoint) transformToTimeSeries(query *tsdb.Query, rows *co
case float64:
timestamp = columnValue * 1000
case time.Time:
timestamp = float64(columnValue.Unix() * 1000)
timestamp = float64(columnValue.UnixNano() / 1e6)
default:
return fmt.Errorf("Invalid type for column time, must be of type timestamp or unix timestamp")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment