Skip to content

Comments

Fix tstzrange with nil upper or lower value#699

Merged
eminano merged 1 commit intoxataio:mainfrom
oldmantaiter:fix-tstzrange-nil-upper-lower
Jan 29, 2026
Merged

Fix tstzrange with nil upper or lower value#699
eminano merged 1 commit intoxataio:mainfrom
oldmantaiter:fix-tstzrange-nil-upper-lower

Conversation

@oldmantaiter
Copy link
Contributor

@oldmantaiter oldmantaiter commented Jan 29, 2026

Description

The previous change to add support for tstzrange in snapshots did not take into account the upper or lower bounds being able to be empty/null making them "infinity" values.

This change sets any nil upper or lower value to an empty time.Time struct which pgx evaluates correctly as being empty.

Related Issue(s)

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Changes Made

  • Checks upper and lower value of range to see if it is nil, if it is sets a zero value time.Time

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

The previous change to add support for tstzrange in snapshots did not
take into account the upper or lower bounds being able to be empty/null
making them "infinity" values.

This change sets any nil upper or lower value to an empty `time.Time` struct
which pgx evaluates correctly as being empty.
@eminano
Copy link
Contributor

eminano commented Jan 29, 2026

Thanks for the fix @oldmantaiter ! 🙌

@eminano eminano merged commit deb20de into xataio:main Jan 29, 2026
6 of 7 checks passed
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