postgresql: minor fixes

- pep8 / style fixes
- Avoid redefining built-in 'file'

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
postgresql: add logs about errors / warnings

give more info to support about what happened while
collecting the report.

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
postgresql: added license and copyright

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
postgresql: allow use TCP socket

allow to use TCP socket and not only UNIX socket
for connecting to postgresql database

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>