[postgresql] reflect fixes from last commit + minor changes