chore: cleanup

This commit is contained in:
dancingCycle 2023-01-05 12:30:44 +01:00
parent 9130887d03
commit 15f83c7f10
2 changed files with 13 additions and 6 deletions

View File

@ -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");
}
/*

View File

@ -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
```