Sequel gem - "FATAL: remaining connection slots are reserved for non-replication superuser connections"

171 views Asked by At

From googling, I know this error seems to be due to connections not being closed properly. However, the way the Sequel gem readme says to use a database is to open a connection using @db = Sequel.connect('postgres://someaddress') and then call various commands after that. I've read some people mention using a code block for the connection, but would that mean I just need to put a code block around my entire program? And won't a connection still get stuck open if there's an error somewhere?

I've tried enabling the connection validator plugin as so:

@db = Sequel.connect('postgres://someaddress')
@db.extension(:connection_validator)

But I'm still getting the same problem.

Any thoughts?

0

There are 0 answers