pgsql: Prevent internal overflows in date-vs-timestamp and related comp

2020-10-07 Thread Tom Lane
Prevent internal overflows in date-vs-timestamp and related comparisons. The date-vs-timestamp, date-vs-timestamptz, and timestamp-vs-timestamptz comparators all worked by promoting the first type to the second and then doing a simple same-type comparison. This works fine, except when the convers

pgsql: Prevent internal overflows in date-vs-timestamp and related comp

2020-10-07 Thread Tom Lane
Prevent internal overflows in date-vs-timestamp and related comparisons. The date-vs-timestamp, date-vs-timestamptz, and timestamp-vs-timestamptz comparators all worked by promoting the first type to the second and then doing a simple same-type comparison. This works fine, except when the convers