Error: remaining connection slots are reserved for non-replication superuser connections. sorry, too many clients already

In case anyone face this issue on Heroku - I faced the same error when deploying in Heroku Postgresql.

Running this command on the Heroku CLI fixes this -

heroku pg:killall