> Why irrecoverably? If the command fails, you just wait and try it
> again.
> You could use the pg_stat tables to work out who is connected and use
> pg_cancel_backend() to kill them. You could "kill -INT" them yourself.
> You could change the pg_hba.conf to forbid logging in and then bouncing
> the server.
I was going to suggest the same things you did, but then I thought
better... the OP is running the thing at night from a client box, not on
the DB, so restart and process listing is probably off limits...
There's 0 chance somebody will close at midnight it's open connection
forgotten when he left office, so wait and retry would not do any good
;-)
And pg_stat will only show you running queries, not the idle
connections.
If you only could list all the connection's pids in a client you could
loop and kill them all. Of course the loop would kill itself too if not
careful enough ;-)
Cheers,
Csaba.