Fix #31 - fix postgresql empty database check

Tested on postgresql 9.3