Correctly handle infinity value in PostgreSQL range type
#31617

y-yagi wants to merge y-yagi:fix_31612 into rails:master

We do not currently have an analysis of these two commits