37 #include <sys/types.h>
49 main(
int argc,
char **argv)
65 conninfo =
"dbname = postgres";
79 "SELECT pg_catalog.set_config('search_path', '', false)");
107 while (nnotifies < 4)
122 FD_ZERO(&input_mask);
123 FD_SET(sock, &input_mask);
125 if (
select(sock + 1, &input_mask, NULL, NULL, NULL) < 0)
136 "ASYNC NOTIFY of '%s' received from backend PID %d\n",
static void PGresult * res
char * PQerrorMessage(const PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
void PQfinish(PGconn *conn)
PGconn * PQconnectdb(const char *conninfo)
int PQsocket(const PGconn *conn)
void PQfreemem(void *ptr)
PGnotify * PQnotifies(PGconn *conn)
ExecStatusType PQresultStatus(const PGresult *res)
PGresult * PQexec(PGconn *conn, const char *query)
int PQconsumeInput(PGconn *conn)
static void exit_nicely(PGconn *conn)
int main(int argc, char **argv)
#define select(n, r, w, e, timeout)