cleanly handle nil user in psql