diff -ruN postgresql-8.1.1-old/contrib/dbase/dbf2pg.c postgresql-8.1.1/contrib/dbase/dbf2pg.c --- postgresql-8.1.1-old/contrib/dbase/dbf2pg.c 2004-09-14 05:28:28.100000000 +0200 +++ postgresql-8.1.1/contrib/dbase/dbf2pg.c 2005-02-11 17:06:24.193256800 +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));