How to change max_connections for Postgres through SQL command

和自甴很熟 提交于 2021-02-07 03:15:46

问题


We have a hosted PostgreSQL, with no access to the system or *.conf files.

I do have a admin access and can connect to it using Oracle SQL developer. Can I run any command to increase the max_connections. All other parameters seems to be ok shared mem and buffers can hold more connections so there is not problem there.


回答1:


Changing max_connection parameter needs a Postgres restart

Commands

  1. Check max_connection just to keep current value in mind

    SHOW max_connections;
    
  2. Change max_connection value

    ALTER SYSTEM SET max_connections TO '500';
    
  3. Restart PostgreSQL server




回答2:


Apparently, the hosted Postgres we are using does not provide this option. (compose.io)

So the work around is to use a pgbouncer to manage you connections better.



来源:https://stackoverflow.com/questions/36085499/how-to-change-max-connections-for-postgres-through-sql-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!