Try connection with specified db when postgres does not work

**SAME AS #867 but for master***

Hi,
here is my attempt to fix #675
the thing is basicaly that we try to connect to 'postgres' db wich is a "protected" db...
from local there is no trouble but from a remote location the postgres db is often no accessible...
so the install fail...

here i change small things to connect to the specified db if the postgres fail

:)