Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change max_connections for Postgres through SQL command

Tags:

postgresql

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.

like image 933
Prasanna Bableshwar Avatar asked Mar 18 '16 13:03

Prasanna Bableshwar


1 Answers

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

like image 170
Sachin Gupta Avatar answered Oct 04 '22 18:10

Sachin Gupta