Skip to content

Commit

Permalink
Propagate MERGE ... WHEN NOT MATCHED BY SOURCE (#7807)
Browse files Browse the repository at this point in the history
DESCRIPTION: Propagates MERGE ... WHEN NOT MATCHED BY SOURCE

It seems like there is not much needed to be done here.
`get_merge_query_def` from `ruleutils_17` is updated with "WHEN NOT
MATCHED BY SOURCE" therefore `deparse_shard_query` parses the merge
query for execution on the shard correctly.

Relevant PG commit:
postgres/postgres@0294df2f1
  • Loading branch information
naisila authored Jan 8, 2025
1 parent 32c058e commit 3e924db
Show file tree
Hide file tree
Showing 3 changed files with 867 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/distributed/planner/merge_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,8 @@ FetchAndValidateInsertVarIfExists(Oid targetRelationId, Query *query)
continue;
}

/* NOT MATCHED can have either INSERT or DO NOTHING */
if (action->commandType == CMD_NOTHING)
/* NOT MATCHED can have either INSERT, DO NOTHING or UPDATE(PG17) */
if (action->commandType == CMD_NOTHING || action->commandType == CMD_UPDATE)
{
return NULL;
}
Expand Down
Loading

0 comments on commit 3e924db

Please sign in to comment.