diff options
Diffstat (limited to 'reset/reset.c')
-rw-r--r-- | reset/reset.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/reset/reset.c b/reset/reset.c deleted file mode 100644 index 5a851ca..0000000 --- a/reset/reset.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * reset.c - * House of Mozart statistic database reset app (c) 2003 oliver - * - * GNU public license *FIXME* - */ - -#include "reset.h" -#include <stdio.h> -#include <getopt.h> -#include <time.h> -#include <libpq-fe.h> - -int main(int argc, char *argv[]) { - PGconn *conn; - char SQL_query[512]; - PGresult *res; - - conn = PQsetdbLogin(PGHOST, PGPORT, PGOPTIONS, PGTTY, DBNAME, LOGIN, PWD); - - - if(CONNECTION_BAD == PQstatus(conn)) { - fprintf(stderr, "Connection to database '%s' failed.\n %s", DBNAME, PQerrorMessage(conn)); - PQfinish(conn); - return 1; - } - - sprintf(SQL_query, ""); - res = PQexec(conn, SQL_query); - - - if((NULL == res) || (PGRES_COMMAND_OK != PQresultStatus(res))) { - printf("Unable to execute query: %s\n %s\n", SQL_query, PQerrorMessage(conn)); - PQclear(res); - PQfinish(conn); - return 1; - } - PQclear(res); - - PQfinish(conn); - - return 0; -} |