Error: FATAL - Remaining Connection Slots Are Reserved for Non-Replication Superuser Connections
Issue
The following error appears:
FATAL: remaining connection slots are reserved for non-replication superuser connections
Environment
Resolution
To resolve the error, do the following:
Find the current connection slot usage and limits in PostgreSQL. Execute the following query in your PostgreSQL instance:
select max_conn, used, res_for_super,((max_conn - res_for_super)-used) as res_for_normal from (select count(*) used from pg_stat_activity) t1, (select setting::int res_for_super from pg_settings where name='superuser_reserved_connections') t2, (select setting::int max_conn from pg_settings where name='max_connections') t3
Contact your database administrator to make changes as needed using the
max_connections
setting in thepostgresql.conf
file.
Cause
PostgreSQL reserves a number of connection slots for superusers. The maximum number of connections is equal to max_connections
- superuser_reserved_connections
. The Fivetran user won't be able to connect if all of the currently open connection slots are reserved for superusers.