摘要: postmaster.c 中,主循环的大致流程如下:/* * Main idle loop of postmaster */ static int ServerLoop(void) { ... 阅读全文
posted @ 2012-07-20 08:34 健哥的数据花园 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 可以说,postmaster是PostgreSQL服务器端的总代理了。通过它,把客户端的请求转给新生成的postgres 进程。postmaster.c 的代码注释中有如下的描述:When a request message is received, we now fork() immediately.The child process performs authentication of the request, and then becomes a backend if successful.This allows the auth code to be written in a s... 阅读全文
posted @ 2012-07-19 14:41 健哥的数据花园 阅读(479) 评论(0) 推荐(0) 编辑
摘要: postmaster.c 中的BackendStartup(Port *port)函数,其中有如下代码:/* in parent, successful fork */ ereport(DEBUG2, (errmsg_internal("forked new backend, pid=%d socket=%d", (int) pid, port->sock))); 为了方便调试,改为:/* ... 阅读全文
posted @ 2012-07-19 13:41 健哥的数据花园 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 在PostgreSQL的源代码 postmaster.c 的BackendStartup 函数中,有如下的部分(中间部分省略):#ifdef EXEC_BACKEND pid = backend_forkexec(port); #else /* !EXEC_BACKEND */ pid = fork_process(); .... #en... 阅读全文
posted @ 2012-07-19 11:30 健哥的数据花园 阅读(584) 评论(0) 推荐(0) 编辑
摘要: PostgreSQL的configure 脚本中有如下代码:if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@& 阅读全文
posted @ 2012-07-19 10:52 健哥的数据花园 阅读(1130) 评论(0) 推荐(0) 编辑
摘要: 磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL内部结构与源代码研究索引页 回到顶级页面:PostgreSQL索引页 [作者:高健@博客园 luckyjackgao@gmail.com] PostgreSQL中,configure中第一段是如下的代码: if test 阅读全文
posted @ 2012-07-19 10:46 健哥的数据花园 阅读(1204) 评论(0) 推荐(0) 编辑
摘要: 磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL杂记页 回到顶级页面:PostgreSQL索引页作者:高健@博客园 luckyjackgao@gmail.comPostgreSQL的configure 脚本中有:if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@& 阅读全文
posted @ 2012-07-19 09:30 健哥的数据花园 阅读(3975) 评论(0) 推荐(0) 编辑
摘要: 由于对Linux 下的configure不很了解,所以进行了一番学习。网上的这篇文非常不错:http://tech.sina.com.cn/s/2004-10-19/1115443045.shtml而且,其中提到了这样一句话:"大家可以看到configure.in内容是一些宏定义,这些宏经autoconf处理后会变成检查系统特性、环境变量、软件必须的参数的shell脚本。"autoconf读取configure.in 的内容,生成脚本名正是 configure。今后将进一步的查看 PostgreSQL的 configure的内容 阅读全文
posted @ 2012-07-18 14:01 健哥的数据花园 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 在编译postgresql 源码的时候,postgresql 的configure 干了些什么呢?应该是对系统进行了一系列的探测,比如OS种类之类。具体来说,这些探测的结果,表现在,运行后,生成下列的文件(以postgresql9.0.2为例):./postgresql-9.0.2/config.log./postgresql-9.0.2/config.status./postgresql-9.0.2/GNUmakefile./postgresql-9.0.2/src/backend/port/dynloader.c./postgresql-9.0.2/src/backend/port/pg_ 阅读全文
posted @ 2012-07-18 10:23 健哥的数据花园 阅读(701) 评论(0) 推荐(0) 编辑
摘要: 在 postmaster.c 中看到这种代码,从Java程序员的角度,看起来是很不爽的:char *ListenAddresses;... if (ListenAddresses) { char *rawstring; List *elemlist; ListCell *l; ...到底何时 ListenAddress 的逻辑值为真呢?试作如下代码进行验证:char *ListenAddresses;intmai... 阅读全文
posted @ 2012-07-17 15:47 健哥的数据花园 阅读(305) 评论(0) 推荐(0) 编辑