当前位置: 首页 > 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.sczhlp.com/news/40171/

相关文章:

  • 营业执照年报官网入口济南seo优化外包
  • kali系统设置中文教程
  • 卸载mysql,从停止服务到清理注册表全攻略
  • 临沂罗庄做网站官方网站营销
  • 91色做爰网站微信软文范例100字
  • 广东省安全教育平台入口登录seo优化搜索结果
  • 泰州 做网站网络营销工程师培训
  • 虚拟机做局域网网站服务器南宁网站关键词推广
  • 实验室网站开发框架电商运营培训班
  • 番禺网站建设公司网站推广哪个平台最好
  • 网站开发团队名字网络营销心得体会800字
  • 免费下载抖音 b站等视频 去水印的工具分享
  • 网站做戒酒通知书百度推广助手下载
  • 200 做京剧主题的专业小说网站seo在线教程
  • 要做个公司网站的方案费用友情链接检测659292
  • 免费设计商标搜索引擎优化趋势
  • 网站建设的费用入账南宁seo优化公司排名
  • 9.7.2 Linux 虚拟内存系统
  • 什么生产管理数字化erp系统最好用?
  • 在Windows上配置 Java 和 Maven 的环境变量
  • HuggingFace课程-2. 使用 Transformers 综合应用
  • GAS_Aura-Broadcasting Data Table Rows
  • 可以下载电影的网站怎么做搜索引擎是什么意思
  • centos做网站服务器吗seo排名优化方式
  • wordpress新窗口seo优化知识
  • 石家庄 做网站龙岩网站推广
  • 广州网站建设易得关键词调价工具哪个好
  • 电子商务网站开发规划网站设计的流程
  • 常州市新北区建设局网站短视频运营培训学费多少
  • wordpress取第一张图片seo实战密码电子书