PostgreSQL的 initdb 源代码分析之十四
继续分析:
/*
* Make the per-database PG_VERSION for template1 only after init'ing it
*/
write_version_file("base/1");
就是在base/1目录下,生成一个 PG_VERSION 文件。
[pgsql@localhost ]$ pwd
/home/pgsql/DemoDir/base/
[pgsql@localhost ]$ cat PG_VERSION
9.1
[pgsql@localhost ]$
接下来:
/* Create the stuff we don't need to use bootstrap mode for */
setup_auth();
展开后看:
/*
* set up the shadow password table
*/
static void
setup_auth(void)
{
PG_CMD_DECL;
const char **line;
static const char *pg_authid_setup[] = {
/*
* The authid table shouldn't be readable except through views, to
* ensure passwords are not publicly visible.
*/
"REVOKE ALL on pg_authid FROM public;\n",
NULL
}; fputs(_("initializing pg_authid ... "), stdout);
fflush(stdout); snprintf(cmd, sizeof(cmd),
"\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL); PG_CMD_OPEN; for (line = pg_authid_setup; *line != NULL; line++)
PG_CMD_PUTS(*line); PG_CMD_CLOSE; check_ok();
}
此时,得到的cmd 是:
/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null
然后再把 pg_authid_setup[] 里的内容送到 postgres里去执行。此处是 ”REVOKE ALL on pg_authid FROM public;”
PostgreSQL的 initdb 源代码分析之十四的更多相关文章
- PostgreSQL的 initdb 源代码分析之十五
继续分析: if (pwprompt || pwfilename) get_set_pwd(); 由于我启动initdb的时候,没有设置口令相关的选项,故此略过. 接下来: setup_depend( ...
- PostgreSQL的 initdb 源代码分析之十二
继续分析 /* Now create all the text config files */ setup_config(); 将其展开: 实质就是,确定各种参数,分别写入 postgresql.co ...
- PostgreSQL的 initdb 源代码分析之十九
继续分析: setup_dictionary(); 展开: 其中: cmd 是:"/home/pgsql/project/bin/postgres" --single -F -O ...
- PostgreSQL的 initdb 源代码分析之十八
继续分析: setup_conversion(); 展开: 其实质是: 运行命令:"/home/pgsql/project/bin/postgres" --single -F -O ...
- PostgreSQL的 initdb 源代码分析之十六
继续分析 setup_description(); 展开后: 就是要把 share/postgres.description 文件的内容读入到 pg_description 和 pg_shdescri ...
- PostgreSQL的 initdb 源代码分析之十
继续分析, 如下这段,因为条件不成立,被跳过: /* Create transaction log symlink, if required */ ) { fprintf(stderr,"I ...
- PostgreSQL的 initdb 源代码分析之二十四
继续分析: make_template0(); 展开: 无需再作解释,就是创建template0数据库 /* * copy template1 to template0 */ static void ...
- PostgreSQL的 initdb 源代码分析之二十五
继续分析: make_postgres(); 展开: 目的是创建postgres数据库. cmd是:/home/pgsql/project/bin/postgres" --single -F ...
- PostgreSQL的 initdb 源代码分析之二十二
继续分析 load_plpgsql(); 展开: 就是让postgres 执行 create extension plpgsql cmd是: "/home/pgsql/project/bin ...
随机推荐
- javascript实现继承的一种方式
function extend(Child, Parent) { var F = function(){}; F.prototype = Parent.prototype; Child.prototy ...
- 众神看过来:IE11下鼠标中键(滚轮)导致的一个似乎无法解决的问题?!
最近在做asp.net mvc项目时遇到一个关于超链接的问题.很是纠结. 问题描述 有一个公司列表展示页.在用鼠标中键(注意了是滚轮)以下简称中键,点击编辑(超链接)的时候在该条数据的下面直接加在一个 ...
- Spring学习之Ioc
Ioc原理讲解:http://www.cnblogs.com/xdp-gacl/p/4249939.html Ioc IoC是一种编程思想,由主动编程变为被动接收. 也就是说,所有的组件都是被动的(p ...
- Oracle日常维护脚本
1.正常停库流程 ps -ef|grep LOCAL=NO|cut -c 9-15|xargs kill -9 shutdown immediate; 2.备份数据库 bac ...
- POJ 1312 Numerically Speaking
题意:a = 1, b = 2, ..., z = 26, aa = 27, ... 给字符串或者数字,输出对应的答案. 解法:类似26进制……但又不完全是……拿java大数模拟了一下…… 代码: i ...
- POJ 1208 The Blocks Problem
The Blocks Problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5397 Accepted: 231 ...
- equals方法
一.equals方法介绍 1.1.通过下面的例子掌握equals的用法 package cn.galc.test; public class TestEquals { public static vo ...
- 获取本机外网IP的方式笔记
1.IP138 网址:http://www.ip138.com/: 分离出的快速查询地址:http://20140507.ip138.com/ic.asp(2014年8月9日有效) 个人经验:百度搜索 ...
- 关于jQuery中,animate、slide、fade等动画的连续触发、滞后反复执行的bug的个人解决办法
照例,现在开头讲个这个问题发生的背景吧: 因为最近要做个操作选项的呼出,然后就想到了用默认隐藏,鼠标划过的时候显示的方法. 刚开始打算添加一个class="active",直接触发 ...
- gcc编译器基本命令和vi编辑器2
!1 os fen时 看电影 聊天.支持多核处理器 分任务 已经绝迹cpu Trobe c 分任务操作系统三大组成部分内核,命令解释器(shell外壳),文件系统2修改文件日期或(创建文件)命令:to ...