postgresql server version as a static variable
In django.db.backends.postgresql.base
and django.db.backends.postgresql_psycopg2.base
modules there is a code:
cursor = self.connection.cursor()
if set_tz:
cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']])
if not hasattr(self, '_version'):
self.__class__._version = get_version(cursor)
if self._version[0:2] < (8, 0):
It means that the server version is checked only at the first connection. I understand that django does not support and maybe will never support multiple different db connections from one process, but this may brake things even in case of database failover
E.g. at one network address there may be postgresql servers of different version available.
Change History
(5)
Triage Stage: |
Unreviewed → Accepted
|
Severity: |
→ Normal
|
Type: |
→ New feature
|
Component: |
Uncategorized → Database layer (models, ORM)
|
Easy pickings: |
unset
|
UI/UX: |
unset
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
In [16439]: