The psycopg2 module content — Psycopg 2.9.3.dev0 …
https://www.psycopg.org/docs/module.htmlThe psycopg2 module content¶. The module interface respects the standard defined in the DB API 2.0.. psycopg2.connect (dsn=None, connection_factory=None, cursor_factory=None, async=False, **kwargs) ¶ Create a new database session and return a new connection object.. The connection parameters can be specified as a libpq connection string using the dsn parameter:
The cursor class — Psycopg 2.9.3.dev0 documentation
https://www.psycopg.org/docs/cursor.htmlThe cursor class¶ class cursor¶. Allows Python code to execute PostgreSQL command in a database session. Cursors are created by the connection.cursor() method: they are bound to the connection for the entire lifetime and all the commands are executed in the context of the database session wrapped by the connection.. Cursors created from the same connection are not …