connect([dbname
], [host
], [port
], [opt
], [tty
], [user
], [passwd
])
dbname
Name of connected database (string/None).
host
Name of the server host (string/None).
port
Port used by the database server (integer/-1).
opt
Options for the server (string/None).
tty
File or tty for optional debug output from backend (string/None).
user
PostgreSQL user (string/None).
passwd
Password for user (string/None).
This method opens a connection to a specified database on a given PostgreSQL server. You can use key words here, as described in the Python tutorial. The names of the key words are the name of the parameters given in the syntax line. For a precise description of the parameters, please refer to the PostgreSQL user manual.