Do not rely on the column type when quoting infinity
Merge pull request #16036 from sgrif/sg-datetime-infinity

Do not rely on the column type when quoting infinity