postgresql 9.5如何更新pg_settings表上的字段? [英] postgresql 9.5 how to update field on pg_settings table?
问题描述
我复制了postgres数据库,但忘了设置端口,然后我尝试使用以下命令更新pg_settings:
I copy postgres database but forgot to set port then i tried to update pg_settings using :
update pg_settings set setting=5453 where name='port';
然后我得到了:
then i got :
错误:如果不重新启动服务器,则无法更改参数端口
ERROR: parameter "port" cannot be changed without restarting the server
谢谢
推荐答案
-
pg_settings是只读视图-您无法通过
UPDATE
更改配置声明。可以通过以下语句更改字段:
The pg_settings is read only view - you cannot to change configuration by
UPDATE
statement. The fields can be changed by statements:
ALTER SYSTEM SET field TO value;
ALTER DATABASE dbnane SET field TO value;
或者您可以直接编辑 postgresql.conf
文件。
or you can directly edit the postgresql.conf
file.
某些文件,例如 port , shared_buffers ,...需要重新启动服务器。您的错误消息显示它。
Some fileds like port, shared_buffers, ... requires the server restart. The your error message shows it.
这篇关于postgresql 9.5如何更新pg_settings表上的字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!