Fix range check in ECPG numeric to int conversion

John Naylor <john.naylor@postgresql.org>

Commit: d9589eb62a2b4bb43a7893b0bb1acd6eb1bdfe9b
Author: John Naylor <john.naylor@postgresql.org>
Date: 2021-07-30T19:59:10Z
Releases: 12.8
Fix range check in ECPG numeric to int conversion

The previous coding guarded against -INT_MAX instead of INT_MIN,
leading to -2147483648 being rejected as out of range.

Per bug #17128 from Kevin Sweet

Discussion: https://www.postgresql.org/message-id/flat/17128-55a8a879727a3e3a%40postgresql.org
Reviewed-by: Tom Lane
Backpatch to all supported branches

Files

Documentation touched

Discussion