improved postgres support