36 #include <sys/types.h>
37 #ifdef HAVE_SYS_SELECT_H
38 #include <sys/select.h>
51 main(
int argc,
char **argv)
67 conninfo =
"dbname = postgres";
81 "SELECT pg_catalog.set_config('search_path', '', false)");
109 while (nnotifies < 4)
124 FD_ZERO(&input_mask);
125 FD_SET(sock, &input_mask);
127 if (
select(sock + 1, &input_mask, NULL, NULL, NULL) < 0)
138 "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)
void PQclear(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)