The following are commands useful for debugging pool connections in a sequelize + pg setup:
Connect to local psql shell
psql -d <DB_NAME>
Connect to remote psql shell
psql --host=<DB_HOST> --port=5432 --username=<DB_USER> --dbname=<DB_NAME>
List max connections
SHOW max_connections;
Get pg connections
SELECT * FROM pg_stat_activity;
Count pg connections
SELECT COUNT(*) from pg_stat_activity;
Display pg connections in a table
SELECT max_conn,used,res_for_super,max_conn-used-res_for_super 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;
Reboot sequelize
dropdb <DB_NAME>; createdb <DB_NAME>; yarn sequelize db:migrate; yarn sequelize db:seed:all; yarn start-dev