Increase the number of connections

  1. Run the command
sed -i s/'max_connections = 300'/'max_connections = 100'/g /etc/postgresql/9.Х/main/postgresql.conf

Where 9.x - your version of PostgreSQL. You can quickly learn the versionby running the command

sudo staffcop info

Or

  1. Open the configuration file with the command
sudo nano /etc/postgresql/9.Х/main/postgresql.conf
  1. Press Ctrl+W, input max_conn and press Enter
  2. Change the value from 100 to 200
  3. Press Ctrl+O for saving, then Ctrl+X for escaping
  4. Restart PostgreSQL with the command:
sudo service postgresql restart