How to fix FATAL: remaining connection slots are reserved for roles with privileges of the "pg_use_reserved_connections" role on an Azure Database for PostgreSQL flexible server.

Abhishek M 20 Reputation points
2024-10-25T12:37:37.95+00:00

Hi. I have a database running on an Azure Database for PostgreSQL flexible server. I have been managing the database using pgAdmin. Now i am not able to access or login as i am getting the following error, FATAL: remaining connection slots are reserved for roles with privileges of the "pg_use_reserved_connections" role. How can this be resolved ?
User's image

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. Vijayalaxmi Kattimani 490 Reputation points Microsoft Vendor
    2024-10-25T13:52:58.76+00:00

    Hi @Abhishek M,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    We would like to inform you that, The error message, “FATAL: remaining connection slots are reserved for roles with privileges of the pg_use_reserved_connections role, indicates that the server has reached its maximum allowed connections, and only privileged roles can use the remaining reserved slots.

    To resolve this issue, you can try the following steps:

    1. Increase the max_connections parameter in Azure Database for PostgreSQL Flexible Server. You can do this in the Azure portal by navigating to your database, selecting Server Parameters, and adjusting max_connections to a higher value.
    2. Check for idle connections that are not being used. You can use the pg_stat_activity view to identify idle connections. You can terminate idle connections using the pg_terminate_backend function.

    We request you to refer the below mentioned link.

    https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/why-restarting-azure-database-for-postgresql-took-long/ba-p/1885780#:~:text=Let's%20say%20you%20have%20PID,for%20PostgreSQL%20planned%20server%20restart

    I hope, This response will address your query and helped you to overcome on your challenges.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.