Skip to content

Commit 3630998

Browse files
zhaowntiezhu
authored andcommitted
fix postgre jdbc upsert mode has not been
filtered primary key. (cherry picked from commit 397289f)
1 parent eab67fa commit 3630998

File tree

1 file changed

+1
-0
lines changed
  • flinkx-connectors/flinkx-connector-postgresql/src/main/java/com/dtstack/flinkx/connector/postgresql/dialect

1 file changed

+1
-0
lines changed

flinkx-connectors/flinkx-connector-postgresql/src/main/java/com/dtstack/flinkx/connector/postgresql/dialect/PostgresqlDialect.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public Optional<String> getUpsertStatement(
7878
.collect(Collectors.joining(", "));
7979
updateClause =
8080
Arrays.stream(fieldNames)
81+
.filter(f -> !Arrays.asList(uniqueKeyFields).contains(f))
8182
.map(f -> quoteIdentifier(f) + "=EXCLUDED." + quoteIdentifier(f))
8283
.collect(Collectors.joining(", "));
8384

0 commit comments

Comments
 (0)