PostgreSQL的 initdb 源代码分析之二十五
继续分析:
make_postgres();
展开:
目的是创建postgres数据库。
cmd是:/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null
/*
* copy template1 to postgres
*/
static void
make_postgres(void)
{
PG_CMD_DECL;
const char **line;
static const char *postgres_setup[] = {
"CREATE DATABASE postgres;\n",
"COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
NULL
}; fputs(_("copying template1 to postgres ... "), stdout);
fflush(stdout); snprintf(cmd, sizeof(cmd),
"\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL); PG_CMD_OPEN; for (line = postgres_setup; *line; line++)
PG_CMD_PUTS(*line); PG_CMD_CLOSE; check_ok();
}
再接下来,就是结束了:
if (authwarning != NULL)
fprintf(stderr, "%s", authwarning); /* Get directory specification used to start this executable */
strcpy(bin_dir, argv[]);
get_parent_directory(bin_dir); printf(_("\nSuccess. You can now start the database server using:\n\n"
" %s%s%spostgres%s -D %s%s%s\n"
"or\n"
" %s%s%spg_ctl%s -D %s%s%s -l logfile start\n\n"),
QUOTE_PATH, bin_dir, (strlen(bin_dir) > ) ? DIR_SEP : "", QUOTE_PATH,
QUOTE_PATH, pg_data_native, QUOTE_PATH,
QUOTE_PATH, bin_dir, (strlen(bin_dir) > ) ? DIR_SEP : "", QUOTE_PATH,
QUOTE_PATH, pg_data_native, QUOTE_PATH); return ;
会给出一些提示信息,类似于:
Success. You can now start the database server using:
/home/pgsql/project/bin/postgres -D /home/pgsql/DemoDir
or
/home/pgsql/project/bin/pg_ctl -D /home/pgsql/DemoDir -l logfile start
PostgreSQL的 initdb 源代码分析之二十五的更多相关文章
- PostgreSQL的 initdb 源代码分析之二十四
继续分析: make_template0(); 展开: 无需再作解释,就是创建template0数据库 /* * copy template1 to template0 */ static void ...
- PostgreSQL的 initdb 源代码分析之二十二
继续分析 load_plpgsql(); 展开: 就是让postgres 执行 create extension plpgsql cmd是: "/home/pgsql/project/bin ...
- PostgreSQL的 initdb 源代码分析之二十
继续分析: setup_privileges(); 展开: 这是设置权限. 其cmd是:"/home/pgsql/project/bin/postgres" --single -F ...
- PostgreSQL的 initdb 源代码分析之二
继续分析 下面这一段,当 initdb --version 或者 initdb --help 才有意义. ) { ], || strcmp(argv[], ) { usage(progname); ...
- PostgreSQL的 initdb 源代码分析之二十三
继续分析: vacuum_db(); 展开: cmd是:/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_ ...
- PostgreSQL的 initdb 源代码分析之二十一
继续分析: setup_schema(); 展开: 实质就是创建info_schema. cmd 是: "/home/pgsql/project/bin/postgres" --s ...
- PostgreSQL的 initdb 源代码分析之十二
继续分析 /* Now create all the text config files */ setup_config(); 将其展开: 实质就是,确定各种参数,分别写入 postgresql.co ...
- PostgreSQL的 initdb 源代码分析之十五
继续分析: if (pwprompt || pwfilename) get_set_pwd(); 由于我启动initdb的时候,没有设置口令相关的选项,故此略过. 接下来: setup_depend( ...
- PostgreSQL的 initdb 源代码分析之十九
继续分析: setup_dictionary(); 展开: 其中: cmd 是:"/home/pgsql/project/bin/postgres" --single -F -O ...
随机推荐
- 当ASP.NET MVC模型验证遇上CKEditor
项目需要,使用到了CKEditor编辑器.这是个很不错的富文本编辑器,但是当它绑定的字段需要进行模型验证的时候,却会出现验证失效的问题.因此本文旨在记录这个问题和给出解决办法.以下以Validatio ...
- 【转载】两个Web.config中连接字符串中特殊字符解决方案
userid = test password = aps'"; 那么连接字符串的写法为: Provider=SQLOLEDB.1;Password="aps'"&quo ...
- 编译boost (windows msvc14)
我的环境 OS: WIN10 (x64) IDE: VS2015 (VC14) http://www.boost.org/ 1. 下载 下载boost包, boost_1_62_0.7z 使用ASIO ...
- C# chart绑定数据的方式整理
C#chart 画图曲线的条数决定是你的数据源也就Series.Series是对象 你动态创建就可以了. 一.数组, List 等简单Collection类型的方式 Series s1= new Se ...
- Hilbert先生旅馆的故事
以前上实变函数的时候稍微讲了下这个故事呢. 来自Hansschwarzkopf 很久很久以前,在欧洲某国的一个小镇上,Hilbert先生开了一家拥有无数个房间的旅馆.一天,旅馆生意红火得一塌糊涂,不到 ...
- 《C++ primer》--第三章
习题3.2 什么是默认构造函数? 解答: 默认构造函数就是在没有显示提供初始化式时调用的构造函数.它由不带参数的构造函数,或者为所有形参提供默认实参的构造函数定义.如果定义某个类的变量时没有提供初始化 ...
- 《零成本实现Web自动化测试--基于Selenium》第二章 Selenium简介和基础
第一部分 Selenium简介 1.Selenium 组建 1.1 Selenium-IDE Selenium-IDC是开发Selenium测试案例的集成开发环境.它像FireFox插件一样的工作,支 ...
- 白盒测试之gmock入门篇
一.gmock是什么 gmock是google公司推出的一款开源的白盒测试工具.gmock是个很强大的东西,测试一个模块的时候,可能涉及到和其他模块交互,可以将模块之间的接口mock起来,模拟交互过程 ...
- apache环境下配置服务器支持https
SSL加密的意义在于保护服务器到客户端的信息或者是客户端到服务器的信息不被监听和篡改. 现在一些主流的网站都已经是通过 https访问了,搜索引擎对此类网站的收录也不存在问题了. 具体的配置流程大概是 ...
- 快速上手Android数据库操作
Android采用关系型数据库SQLite3,它是一个支持SQL轻量级的嵌入式数据库,在嵌入式操作系统上有很广泛的应用,WM采用的也是SQLite3 关于过于.原理方面的东西在这篇文章里不会提到,但是 ...