password = result.password
database = result.path[1:]
hostname = result.hostname
connection = psycopg2.connect(database=database, user=username, password=
    password, host=hostname)
Connect to an URI in postgres