摘要:
继续分析下面的是获取运行此程序的用户名称,主要还是为了防止在linux下用root来运行的情形。 effective_user = get_id(); if (strlen(username) == 0) username = effective_user;接下来,是准备好一写预备生成的文件的名称变量: set_input(&bki_file, "postgres.bki"); set_input(&desc_file, "postgres.description"); set_input(&shdesc_file, " 阅读全文
posted @ 2013-07-05 17:33
健哥的数据花园
阅读(768)
评论(0)
推荐(0)
摘要:
接前面,继续分析:putenv("TZ=GMT") 设置了时区信息。find_other_exec(argv[0], "postgres", PG_BACKEND_VERSIONSTR, backend_exec))就是要找到同目录下、同版本的postgres备用。initdb 执行后期,很多事情要依赖 postgres来处理的。 /* * Also ensure that TZ is set, so that we don't waste time identifying the * system timezone each of the ma 阅读全文
posted @ 2013-07-05 17:07
健哥的数据花园
阅读(869)
评论(0)
推荐(0)
摘要:
继续分析: if (pwprompt && pwfilename) { fprintf(stderr, _("%s: password prompt and password file cannot be specified together\n"), progname); exit(1); } if (authmethod == NULL || !strlen(authmethod)) { authwarning = _("\nWARNING: enabling \"trust\" authentication for ... 阅读全文
posted @ 2013-07-05 16:55
健哥的数据花园
阅读(959)
评论(0)
推荐(0)
摘要:
继续其实接前面,整个while循环是这样的: while ((c = getopt_long(argc, argv, "dD:E:L:nU:WA:sT:X:", long_options, &option_index)) != -1) { switch (c) { ...... } ...... }这一句,c = getopt_long(argc, argv, "dD:E:L:nU:WA:sT:X:", lo... 阅读全文
posted @ 2013-07-05 16:33
健哥的数据花园
阅读(741)
评论(0)
推荐(0)
摘要:
继续分析下面这一段,当 initdb --version 或者 initdb --help 才有意义。 if (argc > 1) { if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0) { usage(progname); exit(0); } if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0) { ... 阅读全文
posted @ 2013-07-05 15:51
健哥的数据花园
阅读(733)
评论(0)
推荐(0)
摘要:
开始第一段:intmain(int argc, char *argv[]){/* * options with no short version return a low integer, the rest return * their short version value */ static struct option long_options[] = { {"pgdata", required_argument, NULL, 'D'}, {"encoding", required_argument, NULL, 'E' 阅读全文
posted @ 2013-07-05 15:32
健哥的数据花园
阅读(1225)
评论(0)
推荐(0)
摘要:
首先,建立表:pgsql=# create table tab10(id integer);CREATE TABLEpgsql=# select 147525::regclass; regclass ---------- tab10(1 row)pgsql=# 查看此时的文件信息:[pgsql@localhost 16384]$ pwd/home/pgsql/DemoDir/base/16384[pgsql@localhost 16384]$ ls -l 147525-rw------- 1 pgsql pgsql 0 Jul 4 13:45 147525[pgsql@localhost 1. 阅读全文
posted @ 2013-07-05 09:40
健哥的数据花园
阅读(2724)
评论(0)
推荐(0)

浙公网安备 33010602011771号