mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-27 03:13:43 +03:00
Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580
This commit is contained in:
parent
8dc26b86fa
commit
41137e4e11
|
@ -1194,7 +1194,7 @@ conn_set_session(connectionObject *self, int autocommit,
|
|||
int want_autocommit = autocommit == SRV_STATE_UNCHANGED ?
|
||||
self->autocommit : autocommit;
|
||||
|
||||
if (deferrable != self->deferrable && self->server_version < 90100) {
|
||||
if (deferrable != SRV_STATE_UNCHANGED && self->server_version < 90100) {
|
||||
PyErr_SetString(ProgrammingError,
|
||||
"the 'deferrable' setting is only available"
|
||||
" from PostgreSQL 9.1");
|
||||
|
@ -1256,7 +1256,7 @@ conn_set_session(connectionObject *self, int autocommit,
|
|||
goto endlock;
|
||||
}
|
||||
}
|
||||
if (self->deferrable != STATE_DEFAULT) {
|
||||
if (self->server_version >= 90100 && self->deferrable != STATE_DEFAULT) {
|
||||
if (0 > pq_set_guc_locked(self,
|
||||
"default_transaction_deferrable", "default",
|
||||
&pgres, &error, &_save)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user