diff -Naur /tmp/DBD-Pg-2.17.1/dbdimp.c DBD-Pg-2.17.1/dbdimp.c
--- /tmp/DBD-Pg-2.17.1/dbdimp.c	2010-04-07 22:49:52.000000000 +0200
+++ DBD-Pg-2.17.1/dbdimp.c	2010-05-31 13:11:30.000000000 +0200
@@ -2472,12 +2472,15 @@
 			sv_catpv(value, "{");
 		}
 		for (yz=0; yz < array_items; yz++) {
-			svitem = *av_fetch(currarr, yz, 0);
-
-			if (SvROK(svitem))
+		    SV **svitem_ptr = av_fetch(currarr, yz, 0);
+		    if (svitem_ptr)
+		      svitem = *svitem_ptr; 
+		    else 
+		      svitem = NULL;
+			if (svitem != NULL && SvROK(svitem))
 				croak("Arrays must contain only scalars and other arrays");
 
-			if (!SvOK(svitem)) { /* Insert NULL if we can */
+			if (svitem == NULL || !SvOK(svitem)) { /* Insert NULL if we can */
 				/* Only version 8.2 and up can handle NULLs in arrays */
 				if (server_version < 80200)
 					croak("Cannot use NULLs in arrays until version 8.2");
