plugins: multiple postgres installs per host

This enables monitoring multiple postgres installs on one host,
typically when having differents postgres versions.

This commit was comprised originally from several commits that were
squashed by Steve.

Closes: #1196