single server: postgres exporter uses common datasource fn
Created by: uwedeportivo
followup PR for https://github.com/sourcegraph/sourcegraph/pull/6744
(addresses @keegancsmith code review)
moves function into dbutil so it can be used more widely