Issue
The following error appears:
FATAL: remaining connection slots are reserved for non-replication superuser connections
Environment
Destination: PostgreSQL
Resolution
Please run the following query in your Postgres 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
This query will show you the current connection slot usage and limits in PostgreSQL. Next, your database administrator can make changes as needed using the max_connections
setting in postgresql.conf
.
Cause
Postgres reserves a number of connection slots for superusers. The maximum number of connections is equal to max_connections
- superuser_reserved_connections
. If all of the currently open connection slots are reserved for superusers, Fivetran's user will not be able to connect.