--- jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java 2008-06-03 14:49:30.000000000 -0400 +++ jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java.orig 2008-06-03 14:49:30.000000000 -0400 @@ -14,6 +14,7 @@ import org.python.core.PyObject; import java.math.BigDecimal; +import java.math.BigInteger; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -122,4 +123,16 @@ super.setJDBCObject(stmt, index, object, type); } } + public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException { + // PostgreSQL doesn't support BigIntegers without explicitely setting the + // type. + Object value = object.__tojava__(Object.class); + if (value instanceof BigInteger) { + super.setJDBCObject(stmt, index, object, Types.BIGINT); + } else { + super.setJDBCObject(stmt, index, object); + } + + } + }