pg_conf_load_time() 是一个系统函数,它显示配置上次成功重载的时间。
pg_conf_load_time() 添加于 PostgreSQL 8.4。
用法
pg_conf_load_time() → timestamp with time zone
源代码
pg_conf_load_time() 报告全局变量 PgReloadTime 的值,该变量定义在 src/include/utils/timestamp.h 中,并在 src/backend/utils/adt/timestamp.c 中实现。
它在启动、重启或接收到 SIGHUP 信号后成功应用配置时,在 src/backend/utils/misc/guc-file.l 中设置。
变更历史
- PostgreSQL 8.4
- 添加(提交 600da67f)
示例
pg_conf_load_time() 的基本用法示例
postgres=# SELECT pg_conf_load_time();
pg_conf_load_time
-------------------------------
2019-07-15 22:07:31.472888+01
(1 row)
postgres=# SELECT pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
postgres=# SELECT pg_conf_load_time();
pg_conf_load_time
-------------------------------
2019-07-15 22:08:16.900608+01
(1 row)
参考资料
- PostgreSQL 文档: 系统信息函数
