aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-12-27 13:32:40 +0900
committerMichael Paquier <michael@paquier.xyz>2024-12-27 13:32:40 +0900
commitd85ce012f99f63249bb45a78fcecb7a2383920b1 (patch)
tree08f039c5367c16204b3ed9944676f79138836708 /src/backend/access/gist
parent61cac71c23686f47c785dc69d3c15cb4304d106f (diff)
downloadpostgresql-d85ce012f99f63249bb45a78fcecb7a2383920b1.tar.gz
postgresql-d85ce012f99f63249bb45a78fcecb7a2383920b1.zip
Improve handling of date_trunc() units for infinite input values
Previously, if an infinite value was passed to date_trunc(), then the same infinite value would always be returned regardless of the field unit given by the caller. This commit updates the function so that an error is returned when an invalid unit is passed to date_trunc() with an infinite value. This matches the behavior of date_trunc() with a finite value and date_part() with an infinite value, making the handling of interval, timestamp and timestamptz more consistent across the board for these two functions. Some tests are added to cover all these new failure cases, with an unsupported unit and infinite values for the three data types. There were no test cases in core that checked all these patterns up to now. Author: Joseph Koshakow Discussion: https://postgr.es/m/CAAvxfHc4084dGzEJR0_pBZkDuqbPGc5wn7gK_M0XR_kRiCdUJQ@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions