> > The problem is that sometimes (apparently random), even after having invoked > EVOKE CONNECT ON DATABASE \"$DB\" FROM PUBLIC;, when the scripts starts > dumping, it fails because it says that there are some active connections.
Revoking connection does not disconnect currently connected clients.