auto-detect postgres