diff -ruN postgresql-7.4.7-old/contrib/dbase/dbf2pg.c postgresql-7.4.7/contrib/dbase/dbf2pg.c
--- postgresql-7.4.7-old/contrib/dbase/dbf2pg.c	2003-09-28 00:24:49.000000000 +0200
+++ postgresql-7.4.7/contrib/dbase/dbf2pg.c	2004-10-31 19:37:00.692543208 +0100
@@ -335,7 +335,10 @@
 		printf("%s\n", query);
 	}
 
-	if ((res = PQexec(conn, query)) == NULL)
+	if ((res = PQexec(conn, query)) == NULL ||
+	    PQresultStatus(res) == PGRES_BAD_RESPONSE ||
+	    PQresultStatus(res) == PGRES_NONFATAL_ERROR ||
+	    PQresultStatus(res) == PGRES_FATAL_ERROR)
 	{
 		fprintf(stderr, "Error creating table!\n");
 		fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
@@ -429,7 +432,10 @@
 			}
 			sprintf(query, "COPY %s FROM stdin", table);
 			res = PQexec(conn, query);
-			if (res == NULL)
+			if (res == NULL ||
+			    PQresultStatus(res)==PGRES_BAD_RESPONSE ||
+			    PQresultStatus(res)==PGRES_NONFATAL_ERROR ||
+			    PQresultStatus(res)==PGRES_FATAL_ERROR)
 			{
 				fprintf(stderr, "Error starting COPY!\n");
 				fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
