Guard PostgreSQL linking. Fix inconsistent code style.