projects
/
users
/
rhaas
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6b9254
)
Minor dbf2pg fixes from Martin Pitt: check for failure when issuing
author
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 6 Oct 2005 23:05:22 +0000
(23:05 +0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 6 Oct 2005 23:05:22 +0000
(23:05 +0000)
CREATE TABLE command, and translate dBase's 'M' field type to 'text'.
contrib/dbase/dbf2pg.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/dbase/dbf2pg.c
b/contrib/dbase/dbf2pg.c
index 8acb65c557a735897e3a53826167c5accb5e9724..c3e50dc4ac23bb4fc410bcb2ccb7717e1f3cbeda 100644
(file)
--- a/
contrib/dbase/dbf2pg.c
+++ b/
contrib/dbase/dbf2pg.c
@@
-301,6
+301,9
@@
do_create(PGconn *conn, char *table, dbhead * dbh)
case 'L':
strcat(query, " char");
break;
+ case 'M':
+ strcat(query, " text");
+ break;
}
}
@@
-312,7
+315,8
@@
do_create(PGconn *conn, char *table, dbhead * dbh)
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));