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 ...
随机推荐
- Swift入门篇-基本类型(1)
博主语文一直都不好(如有什么错别字,请您在下评论)望您谅解,没有上过什么学的 今天遇到了一个很烦的事情是,早上10点钟打开电脑,一直都进入系统(我的系统 mac OS X Yosemite 10.1 ...
- <一>SQL优化1-4
第一条:去除在谓词列上编写的任何标量函数 --->在select 显示列上使用标量函数是可以的.但在where语句后的过滤条件部分对列使用函数,需要考虑.因为执行sql的引擎会因为 ...
- 多线程监控文件夹,FlieSystemWatcher,并使用共享函数
发表于: 2011-01-06 09:55:47 C# code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 ...
- [转] C#中发送消息给指定的窗口,以及接收消息
原文C#中发送消息给指定的窗口,以及接收消息 public class Note { //声明 API 函数 [DllImport("User32.dll", EntryPoint ...
- Matlab编程实例(4) 相位角与相关系数曲线
%相位角与相关系数曲线 close all; clear all; Samp1=200; %设置信号的采样精度 Samp2=200; %设置相位角p分割精度 A=10;%信号幅值 w=1;%信号角 ...
- IOS NSNotificationCenter 通知的使用
1.注册通知 [NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notify) name:@" ...
- iBeacon开发
什么是iBeacons iBeacons是苹果在2013年WWDC上推出一项基于蓝牙4.0(Bluetooth LE | BLE | Bluetooth Smart)的精准微定位技术,当你的手持设备靠 ...
- 举例详细说明javascript作用域、闭包原理以及性能问题(转)
转自:http://www.cnblogs.com/mrsunny/archive/2011/11/03/2233978.html 这可能是每一个jser都曾经为之头疼的却又非常经典的问题,关系到内存 ...
- nodejs+express +jade模板引擎 新建项目
先 安装 nodejsiDEAAM 2015/7/16 22:47:25然后安装 npm install expressiDEAAM 2015/7/16 22:47:35然后安装 npm instal ...
- JavaScript——对this指针的新理解
一直以来对this的理解只在可以用,会用,却没有去深究其本质.这次,借着<JavaScript The Good Parts>,作了一次深刻的理解.(所有调试都可以在控制台中看到,浏览器F ...