继续分析:

    /*
* 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 源代码分析之十四的更多相关文章

  1. PostgreSQL的 initdb 源代码分析之十五

    继续分析: if (pwprompt || pwfilename) get_set_pwd(); 由于我启动initdb的时候,没有设置口令相关的选项,故此略过. 接下来: setup_depend( ...

  2. PostgreSQL的 initdb 源代码分析之十二

    继续分析 /* Now create all the text config files */ setup_config(); 将其展开: 实质就是,确定各种参数,分别写入 postgresql.co ...

  3. PostgreSQL的 initdb 源代码分析之十九

    继续分析: setup_dictionary(); 展开: 其中: cmd 是:"/home/pgsql/project/bin/postgres" --single -F -O ...

  4. PostgreSQL的 initdb 源代码分析之十八

    继续分析: setup_conversion(); 展开: 其实质是: 运行命令:"/home/pgsql/project/bin/postgres" --single -F -O ...

  5. PostgreSQL的 initdb 源代码分析之十六

    继续分析 setup_description(); 展开后: 就是要把 share/postgres.description 文件的内容读入到 pg_description 和 pg_shdescri ...

  6. PostgreSQL的 initdb 源代码分析之十

    继续分析, 如下这段,因为条件不成立,被跳过: /* Create transaction log symlink, if required */ ) { fprintf(stderr,"I ...

  7. PostgreSQL的 initdb 源代码分析之二十四

    继续分析: make_template0(); 展开: 无需再作解释,就是创建template0数据库 /* * copy template1 to template0 */ static void ...

  8. PostgreSQL的 initdb 源代码分析之二十五

    继续分析: make_postgres(); 展开: 目的是创建postgres数据库. cmd是:/home/pgsql/project/bin/postgres" --single -F ...

  9. PostgreSQL的 initdb 源代码分析之二十二

    继续分析 load_plpgsql(); 展开: 就是让postgres 执行 create extension plpgsql cmd是: "/home/pgsql/project/bin ...

随机推荐

  1. 【转】setTag()/getTag()

    原文网址:http://www.cnblogs.com/topcoderliu/archive/2011/06/07/2074419.html View中的setTag(Onbect)表示给View添 ...

  2. MySQL基础之第2章 Windows平台下安装与配置MySQL

    2.1.msi安装包 2.1.1.安装 特别要注意的是,安装前要删除原来的my.ini和原来的data目录,改名也行,不然在最后一步会“apply security settings”报个1045错误 ...

  3. AFNetworking教程

    转:http://www.lanrenios.com/tutorials/network/2012/1126/527.html AFNETWORKING AFNetworking他是一个现在非常用得多 ...

  4. IIS应用程序池回收图文详解

    转:http://blog.sina.com.cn/s/blog_8677fcaa010138uf.html 什么是应用程序池呢?这是微软的一个全新概念:应用程序池是将一个或多个应用程序链接到一个或多 ...

  5. c# 进行AE开发时,如何在地图上定位出一个点

    一.文本形式的气泡提示框 由于本人是初学,所以具体的含义尚未弄清楚,直接给出代码吧!

  6. 有关T-SQL的10个好习惯(转)

    1. 在生产环境中不要出现Select * 这一点我想大家已经是比较熟知了,这样的错误相信会犯的人不会太多.但我这里还是要说一下. 不使用Select *的原因主要不是坊间所流传的将*解析成具体的列需 ...

  7. Chromuim开发机配置

    一个出色的程序员需要一台给力的电脑. 之前使用ThinkPad R400笔记本编译Chromium,确实太痛苦了,第一次编译未使用SSD,超过了24小时都没有编译完.后来断断续续折腾了将近一个月才编译 ...

  8. 《Python核心编程》 第四章 Python对象- 课后习题

    练习 4-1. Python对象.与所有Python对象有关的三个属性是什么?请简单的描述一下. 答:身份.类型和值: 身份:每一个对象都有一个唯一的身份标识自己,可以用id()得到.  类型:对象的 ...

  9. Tableau学习笔记之二

    2张图片解析下Tableau 9.0界面的功能 1.数据加载界面: 2.数据分析界面:

  10. HDU5479 Colmerauer 单调栈+暴力优化

    http://acm.hdu.edu.cn/showproblem.php?pid=5749 思路: bestcoder 84 贡献:所有可能的子矩阵的面积和 //len1:子矩阵所有长的和 ;i&l ...