Skip to content

Commit dd0fa0f

Browse files
committed
Minor dbf2pg fixes from Martin Pitt: check for failure when issuing
CREATE TABLE command, and translate dBase's 'M' field type to 'text'.
1 parent e6b9254 commit dd0fa0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/dbase/dbf2pg.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ do_create(PGconn *conn, char *table, dbhead * dbh)
301301
case 'L':
302302
strcat(query, " char");
303303
break;
304+
case 'M':
305+
strcat(query, " text");
306+
break;
304307
}
305308
}
306309

@@ -312,7 +315,8 @@ do_create(PGconn *conn, char *table, dbhead * dbh)
312315
printf("%s\n", query);
313316
}
314317

315-
if ((res = PQexec(conn, query)) == NULL)
318+
if ((res = PQexec(conn, query)) == NULL ||
319+
PQresultStatus(res) != PGRES_COMMAND_OK)
316320
{
317321
fprintf(stderr, "Error creating table!\n");
318322
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy