diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-31 18:32:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-31 18:32:23 +0000 |
commit | a757fd70e56a2e6c147f9947b305f681150fca9f (patch) | |
tree | 67502329a9b0dfd9ca0078d2fc78256d20a00fbc /src/backend/utils/adt/arrayfuncs.c | |
parent | 54427e9a1b47b8dd6681d927ce1460ebe6b8cb9a (diff) | |
download | postgresql-a757fd70e56a2e6c147f9947b305f681150fca9f.tar.gz postgresql-a757fd70e56a2e6c147f9947b305f681150fca9f.zip |
I think I've finally identified the cause of the off-by-one-second
issue in timestamp conversion that we hacked around for so long by
ignoring the seconds field from localtime(). It's simple: you have
to watch out for platform-specific roundoff error when reducing a
possibly-fractional timestamp to integral time_t form. In particular
we should subtract off the already-determined fractional fsec field.
This should be enough to get an exact answer with int64 timestamps;
with float timestamps, throw in a rint() call just to be sure.
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
0 files changed, 0 insertions, 0 deletions