摘要:
继续分析: vacuum_db();展开:cmd是:/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null其目的很明确,就是 对 template1 数据库执行ANALYZE;VACUUM FULL;VACUUM FREEZE;/* * clean everything up in template1 */static voidvacuum_db(void){ PG_CMD_DECL; fputs(. 阅读全文
摘要:
继续分析 load_plpgsql();展开:就是让postgres 执行 create extension plpgsqlcmd是:"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/nullok/* * load PL/pgsql server-side language */static voidload_plpgsql(void){ PG_CMD_DECL; fputs(_(" 阅读全文
摘要:
继续分析: 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 fi 阅读全文
摘要:
继续分析: setup_privileges();展开:这是设置权限。其cmd是:"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null其命令是:UPDATE pg_class SET relacl = E'{"=r/\\"$POSTGRES_SUPERUSERNAME\\""}' WHERE relkind IN ('r 阅读全文
摘要:
继续分析: setup_dictionary();展开:其中:cmd 是:"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true -j template1 >/dev/nulldictionary_file 是:/home/pgsql/project/share/snowball_create.sql/* * load extra dictionaries (Snowball stemmers) */static voidsetu 阅读全文
摘要:
继续分析: setup_conversion();展开:其实质是:运行命令:"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null传递参数:/home/pgsql/project/share/conversion_create.sql/* * load conversion functions */static voidsetup_conversion(void){ PG_CMD_DECL 阅读全文
摘要:
继续分析: setup_collation()展开:/* * populate pg_collation */static voidsetup_collation(void){#if defined(HAVE_LOCALE_T) && !defined(WIN32) int i; FILE *locale_a_handle; char localebuf[NAMEDATALEN]; int count = 0; PG_CMD_DECL;#endif fputs(_("creating... 阅读全文
摘要:
继续分析 setup_description();展开后:就是要把share/postgres.description 文件的内容读入到 pg_description 和 pg_shdescription/* * load description data */static voidsetup_description(void){ PG_CMD_DECL; fputs(_("loading system objects' descriptions ... "), stdout); fflush(stdout); snprintf(cmd, sizeof(cmd),. 阅读全文