Skip to content

Remove the dead ruby < 2.3 check from the binary timestamp decoder - #760

Merged
larskanis merged 1 commit into
ged:masterfrom
czj:cleanup/binary-timestamp-ruby-version-guard
Oct 26, 2026
Merged

larskanis merged 1 commit into
ged:masterfrom
czj:cleanup/binary-timestamp-ruby-version-guard

Conversation

@czj

@czj czj commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

A small cleanup spotted while working on #759: pg_bin_dec_timestamp still checks for ruby >= 2.3 before taking the rb_time_timespec_new fast path. pg requires ruby 3.1 since #749, so that part of the condition is always true. ruby/version.h was only included for the version check. The same condition in the text timestamp decoder goes away with #759, which removes its timegm() guard, so I left it out of this one to avoid a conflict.

The time_t checks stay. SIZEOF_TIME_T >= 8 keeps builds with a 32-bit time_t (i386, older armhf) on the Time.at path, and NEGATIVE_TIME_T stays because before Ruby 4.0, rb_time_timespec_new rejects negative seconds without it.

No behavior change: pg_binary_decoder.o builds to identical __text and __cstring sections on master and on this branch (Ruby 4.0.9, arm64-darwin), so the fast path is still taken, and the binary timestamp examples of basic_type_map_for_results_spec.rb pass.


🤖 Generated with Claude Code, but prompted, read, and verified by @czj, a caring human :)

pg requires ruby-3.1 since ged#749, so only the time_t conditions remain.
@larskanis
larskanis merged commit 6c42b1a into ged:master Oct 26, 2026
35 checks passed
@czj

czj commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for this review too @larskanis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants