pantry/projects/postgresql.org/libpq/libpq.c
Joe DeCapo bc5a88ce8f +libpq
2023-05-07 16:32:11 -04:00

23 lines
397 B
C

#include <stdlib.h>
#include <stdio.h>
#include <libpq-fe.h>
int main()
{
const char *conninfo;
PGconn *conn;
conninfo = "dbname = postgres";
conn = PQconnectdb(conninfo);
if (PQstatus(conn) != CONNECTION_OK) // This should always fail
{
printf("Connection to database attempted and failed");
PQfinish(conn);
exit(0);
}
return 0;
}