in reply to Database connection checking.

Maybe this recent node answers your question?

Getting all the databases of a PostGreSQL database server.