Repository navigation
Remove the dead ruby < 2.3 check from the binary timestamp decoder - #760
Merged
larskanis merged 1 commit intoOct 26, 2026
Merged
Conversation
pg requires ruby-3.1 since ged#749, so only the time_t conditions remain.
Contributor
Author
|
Thanks for this review too @larskanis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small cleanup spotted while working on #759:
pg_bin_dec_timestampstill checks for ruby >= 2.3 before taking therb_time_timespec_newfast path. pg requires ruby 3.1 since #749, so that part of the condition is always true.ruby/version.hwas only included for the version check. The same condition in the text timestamp decoder goes away with #759, which removes itstimegm()guard, so I left it out of this one to avoid a conflict.The
time_tchecks stay.SIZEOF_TIME_T >= 8keeps builds with a 32-bittime_t(i386, older armhf) on theTime.atpath, andNEGATIVE_TIME_Tstays because before Ruby 4.0,rb_time_timespec_newrejects negative seconds without it.No behavior change:
pg_binary_decoder.obuilds to identical__textand__cstringsections on master and on this branch (Ruby 4.0.9, arm64-darwin), so the fast path is still taken, and the binary timestamp examples ofbasic_type_map_for_results_spec.rbpass.🤖 Generated with Claude Code, but prompted, read, and verified by @czj, a caring human :)