PostgreSQL的 initdb 源代码分析之二十一
继续分析:
setup_schema();
展开:
实质就是创建info_schema。
cmd 是:
"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true -j template1 >/dev/null
infor_schem_file是:/home/pgsql/project/share/information_schema.sql
/** load info schema and populate from features file*/ static void setup_schema(void) {PG_CMD_DECL;char **line;char **lines;fputs(_("creating information schema ... "), stdout);fflush(stdout);lines = readfile(info_schema_file);///fprintf(stderr,"\n====================info_schema_file is: %s\n", info_schema_file);/** We use -j here to avoid backslashing stuff in information_schema.sql*/snprintf(cmd, sizeof(cmd),"\"%s\" %s -j template1 >%s",backend_exec, backend_options,DEVNULL);///fprintf(stderr,"\n=====================cmd is: %s \n",cmd);PG_CMD_OPEN;for (line = lines; *line != NULL; line++){PG_CMD_PUTS(*line);free(*line);}free(lines);PG_CMD_CLOSE;snprintf(cmd, sizeof(cmd),"\"%s\" %s template1 >%s",backend_exec, backend_options,DEVNULL);PG_CMD_OPEN;PG_CMD_PRINTF1("UPDATE information_schema.sql_implementation_info "" SET character_value = '%s' "" WHERE implementation_info_name = 'DBMS VERSION';\n",infoversion);PG_CMD_PRINTF1("COPY information_schema.sql_features "" (feature_id, feature_name, sub_feature_id, "" sub_feature_name, is_supported, comments) "" FROM E'%s';\n",escape_quotes(features_file));PG_CMD_CLOSE;check_ok(); }
PostgreSQL的 initdb 源代码分析之二十一相关推荐
- PostgreSQL的 initdb 源代码分析之二十三
继续分析: vacuum_db(); 展开: cmd是:/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_ ...
- PostgreSQL的initdb 源代码分析之五
接前面,继续分析: putenv("TZ=GMT") 设置了时区信息. find_other_exec(argv[0], "postgres", PG_BACK ...
- PostgreSQL的 initdb 源代码分析之九
继续:下面的是定义信号处理函数. /** now we are starting to do real work, trap signals so we can clean up*//* some o ...
- PostgreSQL的 initdb 源代码分析之十六
继续分析 setup_description(); 展开后: 就是要把 share/postgres.description 文件的内容读入到 pg_description 和 pg_shdescri ...
- PostgreSQL的 initdb 源代码分析之十
继续分析, 如下这段,因为条件不成立,被跳过: /* Create transaction log symlink, if required */if (strcmp(xlog_dir, " ...
- Zepto源代码分析之二~三个API
因为时间关系:本次仅仅对这三个API($.camelCase.$.contains.$.each)方法进行分析 第一个方法变量转驼峰:$.camelCase('hello-world-welcome' ...
- libpcap 源代码分析(二)
网络监控 绝大多数的现代操作系统都提供了对底层网络数据包捕获的机制,在捕获机制之上可以建立网络监控(Network Monitoring)应用软件.网络监控也常简称为sniffer,其最初的目的在于对 ...
- 小米的抢购骗局+小米的抢购页面的源代码分析(二)文本数组的分析
首先小米源代码的一部分是一个非常非常大的字符串数组,分析它非常耗费时间,但是要搞明白必须去做.. var _$ = [ //数组0位置,是空. "", //2位置,是抢购的开始日期 ...
- OVS datapath主流程分析(二十一)
网络报文到达主机后,最终会到达协议栈的netif_receive_skb函数,该函数会通过设备对象的rx_handler函数把报文交给OVS处理. 而该rx_handler函数其实就是OVS 定义的n ...
最新文章
- iis提示“另一个程序正在使用此文件,进程无法访问。(异常来自HRESULT:0x80070020) ”解决办法...
- Mach-O的动态链接相关知识
- 反射机制2,Class类的使用
- Asp.Net Core下的开源任务调度平台ScheduleMaster
- python进群_Manim-python 进群问题之解答
- 蓝桥杯基础练习1-15(python)
- 自动驾驶场景解析:图像分割开发实战
- 一个简单字符型设备驱动及其测试
- IT如何跨越与业务间的那道“鸿沟”?
- 数据结构上机实践第二周项目3——体验复杂度
- 在C#中如何读取枚举值的描述属性
- C语言小游戏之贪吃蛇
- 解析torrent种子信息
- 大数据Kudu使用方法
- 武汉市企业研究开发中心备案
- [SpringBoot的@Async注解和关键字synchronized的使用]
- ceph rgw lc工作流程
- usb的device模式hid配置错误点
- 零基础自学python?大专生靠python涨薪8K,成功上岸,分享全套学习方法及经验
- Linux Wifi共享上网脚本,类似win 7的Connectify工具