1
0
Fork 0

allows pgcli to connect to specified user's database

This commit is contained in:
François Pietka 2015-01-11 01:20:30 +01:00
parent 78819664cd
commit 8d502bf0cc
1 changed files with 5 additions and 2 deletions

View File

@ -98,8 +98,11 @@ class PGCli(object):
# Connect to the database.
if not database:
# default to current OS username just like psql
database = user = getuser()
if user:
database = user
else:
# default to current OS username just like psql
database = user = getuser()
# Prompt for a password immediately if requested via the -W flag. This
# avoids wasting time trying to connect to the database and catching a