#24318: Can't configure Postgres isolation level if using recent psycopg2
-------------------------------------+-------------------------------------
               Reporter:  carljm     |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.7
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 According to [https://docs.djangoproject.com/en/dev/ref/databases
 /#isolation-level our docs], you should be able to set
 `OPTIONS['isolation_level']` on a database connection to configure the
 Postgres isolation level. But according to a report on django-users, which
 I confirmed by code inspection, on at least Django 1.7+ setting
 `OPTIONS['isolation_level']` has no effect if you are using psycopg2
 2.4.2+.

 The only place the configured `isolation_level` is referenced is in the
 backend's
 
[https://github.com/django/django/blob/master/django/db/backends/postgresql_psycopg2/base.py#L198
 _set_autocommit()] method, and there it is only used if using an older
 psycopg2.

 In 1.7 we had a `_set_isolation_level()` method on the PG backend, but it
 was never called, and has since been removed in master.

 This bug probably dates back to the transaction changes in Django 1.6,
 though I haven't confirmed that.

--
Ticket URL: <https://code.djangoproject.com/ticket/24318>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.e8cd82ef04b9d347ca675291419d4e5a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to