psycopg2 connect set adress code example Example: psycopg2 connection conn = psycopg2.connect("dbname=test user=postgres password=secret")