From 64543d7f048b45718e3f5b68d5746f3a92ff287c Mon Sep 17 00:00:00 2001 From: wjxKOI <105590180+WJX20@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:51:09 +0800 Subject: [PATCH] Update CommonRdbmsWriter.java add PostgreSQL bit type conversion --- .../datax/plugin/rdbms/writer/CommonRdbmsWriter.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java index 7b84c32088..2cd00cb120 100755 --- a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java +++ b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java @@ -538,6 +538,13 @@ protected PreparedStatement fillPreparedStatementColumnType(PreparedStatement pr case Types.BIT: if (this.dataBaseType == DataBaseType.MySql) { preparedStatement.setBoolean(columnIndex + 1, column.asBoolean()); + } else if (this.dataBaseType == DataBaseType.PostgreSQL) { + Boolean booleanValue = column.asBoolean(); + if (booleanValue) { + preparedStatement.setString(columnIndex + 1, "1"); + } else { + preparedStatement.setString(columnIndex + 1, "0"); + } } else { preparedStatement.setString(columnIndex + 1, column.asString()); }