and integer datetimes are in use.  Per bug report from Hubert Depesz
Lubaczewski.
Alex Hunsaker
                                                break;
 
                                        case DTK_MILLISEC:
+                                               /* avoid overflowing the fsec field */
+                                               tm->tm_sec += val / 1000;
+                                               val -= (val / 1000) * 1000;
 #ifdef HAVE_INT64_TIMESTAMP
                                                *fsec += rint((val + fval) * 1000);
 #else
 
  * TimeOffset and fsec_t are convenience typedefs for temporary variables
  * that are of different types in the two cases.  Do not use fsec_t in values
  * stored on-disk, since it is not the same size in both implementations.
+ * Also, fsec_t is only meant for *fractional* seconds; beware of overflow
+ * if the value you need to store could be many seconds.
  */
 
 #ifdef HAVE_INT64_TIMESTAMP