
PGconn *pg_conn;

  /* Open a connection to the database */
  pg_conn = PQsetdb("localhost", NULL, NULL, NULL, "teaserdb");
  /* check it opened OK */
  if(PQstatus(pg_conn) == CONNECTION_BAD){
	t_error(PQerrorMessage(pg_conn), TRUE);
  }


  PQfinish(pg_conn);