#138 ✓ invalid
Pierre-Louis Bonicoli

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

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

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".

Comments and changes to this ticket

  • Daniele Varrazzo

    Daniele Varrazzo November 12th, 2012 @ 01:45 AM

    • 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.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Attachments

Pages