[Django]-Configuring REPEATABLE READ or SERIALIZED transaction isolation for Django on PostgreSQL

2👍

The easiest and most compatible way of doing this would be to write your own DB adapter that inherits from django’s default and overrides the methods so that you set your own isolation level.

1👍

That seems odd. AUTOCOMMIT isn’t a transaction isolation level. READ COMMITTED is PostgreSQL’s default, and you’d get READ COMMITTED behavior with either 1 or 2.

I think you’re looking for set_session([isolation_level,] [readonly,] [deferrable,] [autocommit]).

Do both current and future versions of Django make it hard to specify
these higher isolation levels because they cause huge problems in
practice?

As far as I can tell, the issues have more to do with MySQL and backward compatibility than with PostgreSQL. MySQL defaults to REPEATABLE READ; some Django developers think that READ COMMITTED behavior is not as thoroughly tested as it should be.

https://code.djangoproject.com/ticket/13906

Leave a comment