Repository navigation
Print + before a positive interval count that follows a negative one - #172
Merged
Merged
Conversation
LucaCappelletti94
force-pushed
the
upstream/interval-mixed-sign
branch
from
October 28, 2026 22:23
6fd777f to
69c6460
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
PostgreSQL prints
interval '-1 day 2 hours'as-1 days +02:00:00. Under the defaultIntervalStyleit marks a positive count or clock with+when the count printed just before it was negative. pg2sqlite joined the counts with a plain space and stored-1 days 02:00:00, so the same mixed-sign interval written as a literal and synced from the server became two different strings in the replica, and an equality filter orDISTINCTsaw two values.to_postgres_textnow followsAddPostgresIntPartin PostgreSQL'sdatetime.c, where the sign of each non-zero count decides the+of the next count only, so-1 year 1 day 2 hoursprints-1 years +1 day 02:00:00. The new test pins literals checked against PostgreSQL 18. Reading the stored text back already accepted the+.CI needs connetto-rs/sql-traits#172 first, because sqlparser
maincurrently breaks sql-traitsmain.