Thank you Masahiko, Tristan, Christophe, and Zsolt for the reviews and
feedback. Addressing the feedback in a single email.
Attached v2 addressing the feedback:
- Moved infinity check before timestamp arithmetic [Masahiko] - Used INT64CONST() for the 48-bit constant [Masahiko] - Added documentation for the valid timestamp range [Masahiko, Christophe] - Added a test for '292230 years' to cover the overflow path caught by pg_add_s64_overflow() [Zsolt Parragi]