Repository navigation
fix: Accept equal timestamps in the Postgres timestamp conflict check - #425
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ferenc Csaky <ferenc@datasqrl.com>
HasanAlpCaferoglu
approved these changes
Oct 21, 2026
ferenc-csaky
enabled auto-merge (squash)
October 21, 2026 14:55
ferenc-csaky
added a commit
that referenced
this pull request
Oct 21, 2026
…#425) Signed-off-by: Ferenc Csaky <ferenc@datasqrl.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
What does this change?
The Postgres
timestampconflict action now overwrites a row when the incoming timestamp is equal to the stored one (>=instead of>). Flink keeps the later row on a timestamp tie, but the sink kept the earlier one, so these updates were lost:DISTINCT(keep-last-row deduplication) with two versions at the same timestamp.MINorMAXtimestamp does not change, for example when a late event updatesCOUNTandSUMbut notMAX(ts).GREATEST(...)timestamp, when only the side with the older timestamp changes (fix(skill): Timestamp reasoning inimplement-sqrlsqrl#2490).A version with an older timestamp is still skipped.
Area
flink-sql-runner)connectors)formats)stdlib)env-utils)testing)README.md,stdlib-docs)How did you test it?
SqrlPostgresTimestampConflictTest. It runs the generated upsert against Postgres (Testcontainers) with a newer, an equal and an older timestamp. The equal case fails without this change.SqrlPostgresDialectTestfor the new predicate.mvn test -pl connectors/postgresql-connectorpasses (17 tests), and the Spotless checks pass.mainend to end with only this change in the jar. TheDISTINCTtie and theMIN/MAXaggregate cases now store the same rows as Flink computes. Before, they kept the first version.Trade-off: during a replay after a restart, a replayed version with the same timestamp as the stored row overwrites it until the replay catches up. Versions with an older timestamp are still rejected.
Checklist
feat:,fix:ordocs:, optionally with a scope (e.g.fix(flexible-json):)mvn clean installpasses locally and the code is formatted withmvn spotless:apply(ran the module's tests and Spotless only)given_when_thennaming, AssertJ assertions)pom.xml(not applicable)git commit -s -S)README.mdandstdlib-docsare updated if user-facing behavior or functions changed🤖 Generated with Claude Code