postgresql 如何永久设置 Postgres 9.4 的时区

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32423037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:01:09  来源:igfitidea点击:

How to set timezone for Postgres 9.4 permanently

postgresql

提问by Jecki

I'm running Postgres 9.4. Every time I change it it's returning to default GMT after I reboot,

我正在运行 Postgres 9.4。每次我更改它时,它都会在我重新启动后返回默认 GMT,

> $ psql -c 'show timezone'   

TimeZone

时区

>  US/Central

Is there a parameter option to be added in postgres.conf?

postgres.conf 中是否有要添加的参数选项?

回答by Valery Viktorovsky

You can set timezoneparam into pgsql/data/postgresql.conffile:

您可以将timezone参数设置为pgsql/data/postgresql.conf文件:

timezone = 'US/Central'

and then restart postgresql sever.

然后重新启动 postgresql 服务器。