autocommit
psycopg2 は、次のキーワード引数をサポートするとは主張していませんconnect
。
connect(dsn=None, database=None, user=None, password=None, host=None, port=None, connection_factory=None, async=False, **kwargs)
Create a new database connection.
The connection parameters can be specified either as a string:
conn = psycopg2.connect("dbname=test user=postgres password=secret")
or using a set of keyword arguments:
conn = psycopg2.connect(database="test", user="postgres", password="secret")
The basic connection parameters are:
- *dbname*: the database name (only in dsn string)
- *database*: the database name (only as keyword argument)
- *user*: user name used to authenticate
- *password*: password used to authenticate
- *host*: database host address (defaults to UNIX socket if not provided)
- *port*: connection port number (defaults to 5432 if not provided)
Using the *connection_factory* parameter a different class or connections
factory can be specified. It should be a callable object taking a dsn
argument.
Using *async*=True an asynchronous connection will be created.
Any other keyword parameter will be passed to the underlying client
library: the list of supported parameter depends on the library version.
現在のpostgresqlのドキュメントでは、「autocommit」パラメータについても議論されていません:
http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
おそらく問題は、これが psycopg2 接続の自動コミットを無効にする正しい方法ではないことです。それとは別に、自動コミットをオフにしても実際にはまったく役に立たないことがわかります。 adbapi.ConnectionPool
明示的なトランザクションを開始してコミットするため、動作autocommit
モードを回避することができます。