Added DuplicateKeyError, and login for Pgsql
Added query timeout