CREATE TABLE command, and translate dBase's 'M' field type to 'text'.
case 'L':
strcat(query, " char");
break;
+ case 'M':
+ strcat(query, " text");
+ break;
}
}
printf("%s\n", query);
}
- if ((res = PQexec(conn, query)) == NULL)
+ if ((res = PQexec(conn, query)) == NULL ||
+ PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "Error creating table!\n");
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));