diff --git a/example1/main.c b/example1/main.c index 5b6add7..ad5d68e 100644 --- a/example1/main.c +++ b/example1/main.c @@ -42,11 +42,12 @@ main(int argc, char **argv) } /* Check to see that the backend connection was successfully made */ - if (PQstatus(conn) != CONNECTION_OK) - { - fprintf(stderr, "Connection to database failed: %s", - PQerrorMessage(conn)); - exit_nicely(conn); + if (PQstatus(conn) != CONNECTION_OK){ + fprintf(stderr, "Connection to database failed: %s", + PQerrorMessage(conn)); + exit_nicely(conn); + }else{ + printf("main() Connection to database succeded\n"); } /* diff --git a/lib-version/readme.md b/lib-version/readme.md index 616a262..8156961 100644 --- a/lib-version/readme.md +++ b/lib-version/readme.md @@ -1,5 +1,11 @@ * build instruction ``` -gcc -o main main.c -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq -std=c99 +make +``` + +* run + +``` +./main ```