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

Commite7b90c5

Browse files
committed
Add hint to run "pgbench -i", if test tables don't exist.
Fabien Coelho, reviewed by Julien Rouhaud
1 parent6e5d9f2 commite7b90c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/bin/pgbench/pgbench.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555

5656
#include"pgbench.h"
5757

58+
#defineERRCODE_UNDEFINED_TABLE "42P01"
59+
5860
/*
5961
* Multi-platform pthread implementations
6062
*/
@@ -3252,7 +3254,14 @@ main(int argc, char **argv)
32523254
res=PQexec(con,"select count(*) from pgbench_branches");
32533255
if (PQresultStatus(res)!=PGRES_TUPLES_OK)
32543256
{
3257+
char*sqlState=PQresultErrorField(res,PG_DIAG_SQLSTATE);
3258+
32553259
fprintf(stderr,"%s",PQerrorMessage(con));
3260+
if (sqlState&&strcmp(sqlState,ERRCODE_UNDEFINED_TABLE)==0)
3261+
{
3262+
fprintf(stderr,"Perhaps you need to do initialization (\"pgbench -i\") in database \"%s\"\n",PQdb(con));
3263+
}
3264+
32563265
exit(1);
32573266
}
32583267
scale=atoi(PQgetvalue(res,0,0));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp