摘要: 磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面:PostgreSQL基础知识与基本操作索引页 回到顶级页面:PostgreSQL索引页接PostgreSQL的notify 与listen (六)的内容,探讨一下谁真正接受notify 消息。修改PostgreSQL的源代码:src/backend/command/async.c:NotifyMyFrontEnd(const char *channel, const char *payload, int32 srcPid)函数if (whereToSendOutput == DestRemote){ StringInfoData ... 阅读全文
posted @ 2012-07-13 16:10 健哥的数据花园 阅读(800) 评论(0) 推荐(0) 编辑
摘要: 磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面:PostgreSQL基础知识与基本操作索引页 回到顶级页面:PostgreSQL索引页开两个终端执行psql,进行notify 与 listen动作的实验,当时我有一个疑问:从listen 端看到的PID ,到底是谁的ID?验证如下:启动 postgres, 执行 ps -ef|grep postgres看到除了系统级别的postgres外,并没有其他的。postgres -D /usr/local/data (进程号为19651/父进程号为1)postgres:writer processpostgres:wal writer pro. 阅读全文
posted @ 2012-07-13 15:09 健哥的数据花园 阅读(542) 评论(0) 推荐(0) 编辑
摘要: src/test/examples/testlibpq2.c 中,有如下一段代码:sock = PQsocket(conn); FD_ZERO(&input_mask); FD_SET(sock, &input_mask); if (select(sock + 1, &input_ma... 阅读全文
posted @ 2012-07-13 12:30 健哥的数据花园 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 程序逻辑大致如下: /* Make a connection to the database */ conn = PQconnectdb(conninfo); /* Check to see that the backend connection was successfully made */ if (PQstatus(conn) != CONNECTION_OK) { fprintf(stderr, "Connection to database failed: %s", PQerrorMessage(conn));... 阅读全文
posted @ 2012-07-13 10:21 健哥的数据花园 阅读(449) 评论(0) 推荐(0) 编辑