Reject FOR PORTION OF distributed modifications - #8763
Open
ibrahim halatci (ihalatci) wants to merge 1 commit into
Open
Reject FOR PORTION OF distributed modifications#8763ibrahim halatci (ihalatci) wants to merge 1 commit into
ibrahim halatci (ihalatci) wants to merge 1 commit into
Conversation
Citus cannot preserve the leftover rows generated by PostgreSQL 19 temporal UPDATE and DELETE planning. Reject those statements before other distributed target and routing checks while leaving ordinary local execution to PostgreSQL. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pg19-support #8763 +/- ##
================================================
- Coverage 88.74% 88.74% -0.01%
================================================
Files 289 289
Lines 65065 65067 +2
Branches 8200 8201 +1
================================================
- Hits 57743 57742 -1
- Misses 4957 4959 +2
- Partials 2365 2366 +1 🚀 New features to boost your workflow:
|
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.
Reject PG19 FOR PORTION OF statements requiring distributed planning
PostgreSQL 19 rewrites temporal
UPDATEandDELETEstatements into the requested portion plus leftover rows for the unaffected temporal ranges. Citus cannot currently preserve those leftover rows during distributed planning, which could otherwise cause silent data loss.This change adds a mandatory
PG_VERSION_NUM >= PG_VERSION_19guard at the start ofModifyPartialQuerySupported()and returnsERRCODE_FEATURE_NOT_SUPPORTEDbefore target or routing validation. There is noMERGEguard because the PG19 grammar acceptsFOR PORTION OFonly forUPDATEandDELETE.The PG19 regression coverage includes both
FROM ... TO ...and(portion)syntax forms. It verifies native PostgreSQL behavior and exact leftover fragments for a pure ordinary local table, while rejecting distributedUPDATEandDELETEwith local execution enabled and disabled, a modifying CTE, an ordinary local target reading a distributed source, and a period-as-distribution-columnDELETE. Pure-local statements bypass distributed planning and remain supported.Validation:
CFLAGS=-Werrorpg19,multi_modifications, andcitus_local_tables_queriesregression testsmake check-stylegit diff --checkCloses #8761