Example:
=> create table r(t timestamp);
CREATE TABLE
=> insert into r values(
timestamp '294277-01-09 00:00:00' + interval '36 hour'
);
INSERT 0 1
=> select * from r;
ERROR: timestamp out of range
(A similar case with different values exists when compiled with
--disable-integer-datetimes.)
It looks like timestamp[tz]_pl_interval() is not doing proper validation
in all paths.
Patch attached. I looked for other areas that might be affected, but
none jumped out.
The patch does not introduce any tests because I couldn't think of a
good way to test both integer and float timestamps properly.
Regards,
Jeff Davis