Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd0fa0f

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 parente6b9254 commitdd0fa0f

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)

[8]ページ先頭

©2009-2025 Movatter.jp