Improve pgsql directory lookup