--- pgresult.c.orig Thu Jan 19 14:21:04 2006 +++ pgresult.c Thu Jan 19 14:22:53 2006 @@ -367,7 +367,11 @@ break; #endif } - push_string(make_shared_binary_string(value,k)); + if (PQgetisnull(THIS->result, THIS->cursor, j)) { + push_int(0); + } else { + push_string(make_shared_binary_string(value,k)); + } if(binbuf) free(binbuf); }