diff --git a/rm-datasource/src/main/java/io/seata/rm/datasource/exec/postgresql/PostgresqlInsertExecutor.java b/rm-datasource/src/main/java/io/seata/rm/datasource/exec/postgresql/PostgresqlInsertExecutor.java index 58e68301467..9f6ff0f8ef9 100644 --- a/rm-datasource/src/main/java/io/seata/rm/datasource/exec/postgresql/PostgresqlInsertExecutor.java +++ b/rm-datasource/src/main/java/io/seata/rm/datasource/exec/postgresql/PostgresqlInsertExecutor.java @@ -31,6 +31,7 @@ import io.seata.sqlparser.struct.SqlMethodExpr; import io.seata.sqlparser.struct.SqlSequenceExpr; import io.seata.sqlparser.struct.SqlDefaultExpr; +import io.seata.sqlparser.util.ColumnUtils; import io.seata.sqlparser.util.JdbcConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -109,8 +110,9 @@ public boolean containsAnyPk() { if (CollectionUtils.isEmpty(pkColumnNameList)) { return false; } - return pkColumnNameList.stream().anyMatch(pkColumn -> insertColumns.contains(pkColumn) - || CollectionUtils.toUpperList(insertColumns).contains(pkColumn.toUpperCase())); + List newColumns = ColumnUtils.delEscape(insertColumns, getDbType()); + return pkColumnNameList.stream().anyMatch(pkColumn -> newColumns.contains(pkColumn) + || CollectionUtils.toUpperList(newColumns).contains(pkColumn.toUpperCase())); } @Override