public static boolean checkSchemaExist(final Connection conn, final String schemaName) throws Exception {
        boolean result = false;
        if (POSTGRESQL_DEFAULT_SCHEMA.equals(schemaName)) {
            result = true;
        } else {
            final String checkColumnSql = PostgreSQLSqlBuilder.getCheckSchema(schemaName);
            try (Statement statement = conn.createStatement();
                    ResultSet resultSet = statement.executeQuery(checkColumnSql)) {
                if (Objects.nonNull(resultSet) && resultSet.next()) {
                    int count = resultSet.getInt(1);
                    if (count > 0) {
                        result = true;
                    }
                }
            }
        }
        LOG.info("check schema exist for schema={}, result={}", schemaName, result);
        return result;
    }
Check whether the schema exists.

@param conn JDBC Connection  {@link Connection}
@param schemaName PostgreSQL schema name
@return true if schema exist in the table, otherwise false
@throws Exception on check column exist error
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/postgresql/PostgreSQLJdbcUtils.java