postgreSQL notes
Django supports PostgreSQL 9.0 and higher. It requires the use of Psycopg2 2.0.9 or higher.
Optimizing postgreSQL's configuration
Django needs the following parameters for its database connections:
client_encoding
:'UTF8'
,default_transaction_isolation
:'read committed'
by default, or the value set in the connection options (see here),timezone
:'UTC'
whenUSE_TZ
isTrue
, value ofTIME_ZONE
otherwise.
If these parameters already have the correct values, Django won't set them for every new connection, which improves performance slightly. You can configure them directly in postgresql.conf
or more conveniently per database user with ALTER ROLE
.
Django will work just fine without this optimization, but each new connection will do some additional queries to set these parameters.
Isolation level
Like PostgreSQL itself, Django defaults to the READ COMMITTED
isolation level. If you need a higher isolation level such as REPEATABLE READ
or SERIALIZABLE
, set it in the OPTIONS
part of your...