Postgresql: too many connections for role

could not connect to the primary server: FATAL: too many connections for role

1
2
psql -h master_server
select * from pg_roles;

take a look at column «rolconnlimit»

1
alter role rolename connection limit -1;

— disable connection limits for rolename.