Name of connected database (string/None).
Name of the server host (string/None).
Port used by the database server (integer/-1).
Options for the server (string/None).
File or tty for optional debug output from backend (string/None).
PostgreSQL user (string/None).
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.
import pg con1 = pg.connect('testdb', 'myhost', 5432, None, None, 'bob', None) con2 = pg.connect(dbname='testdb', host='localhost', user='bob')
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.