Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Doc: connection, replace "session" with "connection"

#138

In documentation (https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git;a=blob;f=d...), the first sentence explain that connection class "encapsulates a database connection". Then the terms "connection" and "session" designate the same thing. It would be clearer if "session" was replaced with "connection".

Besides "session" is used instead of "transaction" in usage.rst: "terminate the session using the methods ~connection.commit()".

Attached patch replace "session" with "connection" or "database session".

Reported by Pierre-Louis Bonicoli · November 12th, 2012 @ 01:09 AM

State: invalid
Milestone: none
Assigned to: nobody

Activity

  1. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from new to invalid
    • Tag set to documentation

    Hello, thank you very much for the review.

    I don't agree with many of the objections raised, except two errors I've fixed in this commit. The usage of "session" and "connection" is consistent across the documentation.

    The "session" is a state existing in the server; the "connection" is the python object handling a session. There is no oversight in the sentence "[the connection] Handles the connection to a PostgreSQL database instance. It encapsulates a database session." RESET manipulates properties of the session because, when received, the server changes the session properties there; if anything changes in the connection is just a consequence. "autocommit" OTOH is a property of the connection, because there is no such concept in the server session: the autocommit state only tells the connection not to issue BEGIN statements before the first query. "Idle in transaction" is a session state, not connection's. And so on.

    November 12th, 2012 @ 01:45 AM