Made postgres database name configurable.

Fixes issue #523.