mirror of
https://github.com/postgres/postgres.git
synced 2025-06-05 23:56:58 +03:00
Minor dbf2pg fixes from Martin Pitt: check for failure when issuing
CREATE TABLE command, and translate dBase's 'M' field type to 'text'.
This commit is contained in:
parent
e6b92542a3
commit
dd0fa0f958
@ -301,6 +301,9 @@ do_create(PGconn *conn, char *table, dbhead * dbh)
|
|||||||
case 'L':
|
case 'L':
|
||||||
strcat(query, " char");
|
strcat(query, " char");
|
||||||
break;
|
break;
|
||||||
|
case 'M':
|
||||||
|
strcat(query, " text");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +315,8 @@ do_create(PGconn *conn, char *table, dbhead * dbh)
|
|||||||
printf("%s\n", query);
|
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, "Error creating table!\n");
|
||||||
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
|
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user