当前位置: 首页 > news >正文

遵义原创网站搭建网站一般多少钱

遵义原创网站,搭建网站一般多少钱,公司变更地址流程,太原网页设计最新招聘信息目录 增加guc参数 initdb参数传递 pg_ctl参数传递 参数验证 新增guc参数pg_test_parameter,支持从initdb和pg_ctl命令中传递/覆盖参数,使用场景是TDE透明加密指定算法或者某些定制化需求。 增加guc参数 pg源码是这样描述guc参数的:它是全局…

目录

增加guc参数

 initdb参数传递

 pg_ctl参数传递

参数验证


新增guc参数pg_test_parameter,支持从initdb和pg_ctl命令中传递/覆盖参数,使用场景是TDE透明加密指定算法或者某些定制化需求。

增加guc参数

        pg源码是这样描述guc参数的:它是全局配置管理模式(包括set命令、conf配置文件或其他方式指定参数),我们postgresql.conf文件中所有参数都在这里面,但它是conf文件超集,还有一些配置是不能对用户提供的。

* Support for grand unified configuration scheme, including SET
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.

比如postgresql.conf中定义wal段大小的参数:

		{"max_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS,gettext_noop("Sets the WAL size that triggers a checkpoint."),NULL,GUC_UNIT_MB},

本次我们新增1个guc参数pg_test_parameter,直接仿照src/utils/misc/guc.c文件中的data_directory参数定义,这个参数指定后也是不允许修改的,并且在initdb和pg_ctl都需要指定,跟我们本次想实现的参数类似,但是两者的GucContext和config_group类型有差异;

		{"data_directory", PGC_POSTMASTER, FILE_LOCATIONS,gettext_noop("Sets the server's data directory."),NULL,GUC_SUPERUSER_ONLY | GUC_DISALLOW_IN_AUTO_FILE},&data_directory,NULL,NULL, NULL, NULL},{{"pg_test_parameter", PGC_INTERNAL, PRESET_OPTIONS,gettext_noop("Sets pg test parameter."),NULL,GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},&pg_test_parameter,NULL,NULL, NULL, NULL},

定义后就会有pg_test_parameter这个全局参数了,但是定义参数要用起来。 

 initdb参数传递

支持initdb方式传递pg_test_parameter,需要接受参数输入,这里增加-p的参数读取与参数解析逻辑,在/src/bin/initdb/initdb.c中:

//增加-p参数printf(_("  -p, --pg-test-parameter                show pg_test_parameter settings\n"));
//在main函数中把它定义为必须传递的参数static struct option long_options[] = {// ...{"pg-test-parameter", required_argument, NULL, 'N'}// ...};
//增加参数解析while ((c = getopt_long(argc, argv, "A:dD:E:gkL:nNsST:U:WX:p:", long_options, &option_index)) != -1){switch (c){// ...case 'p':pg_test_parameter = pg_strdup(optarg);break;// ...}}
// 增加日志if (pg_test_parameter){printf(_("pg_test_parameter ok. \n"));}elseprintf(_("pg_test_parameter not ok..\n"));

这里完成initdb的参数传递,直接通过initdb -p abc方式将pg_test_parameter参数设置成abc。

 pg_ctl参数传递

这里传入后根据需要读取

// 增加参数读入while ((flag = getopt(argc, argv, "B:p:c:d:D:Fkr:x:X:-:")) != -1){switch (flag){// ...case 'p':pg_test_parameter = pstrdup(optarg);break;// ...
}
}

参数验证

initdb指定-p参数:

 ./initdb -D ~/data -p abc
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".Data page checksums are disabled.creating directory /home/postgres/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
pg_test_parameter ok.initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.Success. You can now start the database server using:./pg_ctl -D /home/postgres/data -l logfile start

查看参数(调试中):


postgres=# show pg_test_parameter;pg_test_parameter
-------------------(1 row)

http://www.yayakq.cn/news/50263/

相关文章:

  • 设计师网站使用不了怎么让自己的电脑做网站服务器
  • 服装厂家东莞网站建设中国建设银行手机银行app下载
  • 郴州建设企业网站wordpress允许注册
  • 襄阳网站推广优化技巧网站滑动效果怎么做
  • 2019广东省工程建设网站谁知道深圳松岗天桥旁的网站建设
  • 域名连接到网站国内网站没备案
  • 开平市网站建设实验一 html静态网站开发
  • oppo网站开发设计动态速写网站
  • 河南省示范校建设专题网站广西建网站
  • 游戏网站的建设网络推广策划案格式模板和范文
  • 安徽省建设工程安全+协会网站阜新网站优化
  • 给别人做网站前要问些什么问题怎么选择丹徒网站建设
  • 兰州 电子 网站建设网站建设一般是用哪个软件
  • 毕业设计 网站开发简单吗做画册去什么网站找素材
  • 网站建设证据保全旅游网站建设水平评价
  • 智慧团建团员登录网站phpcmsv9手机网站
  • 购物网站开发面试郑州做网站软件
  • 网站文字列表页模板电商网站建设标准
  • 免费软件下载网站网站开发实训报告
  • 东莞手机网站公司网站打开显示建设中
  • 自建网站优缺点做的好的微信商城网站
  • 商场网站建设模板百度帐号管家
  • 哪个网站做兼职可以赚钱编程课哪个培训机构好
  • 做ppt网站大全云技术在网站建设中的应用
  • 简历在线制作网站制作平台网站费用
  • 做代售机票网站程序推进网站集约化建设 网络安全
  • 广安建设厅官方网站友情链接还有用吗
  • 北京网站优化厂家天津贝宏建筑工程有限公司
  • 天津网站建设哪家权威软件公司运营是做什么的
  • 郑州网站创建php做商城网站