Ticket #6433: postgres-funny-version2.diff
File postgres-funny-version2.diff, 866 bytes (added by , 17 years ago) |
---|
-
django/db/backends/postgresql/operations.py
9 9 10 10 def _get_postgres_version(self): 11 11 if self._postgres_version is None: 12 import re 12 13 from django.db import connection 14 version_search = re.compile(r'(\d+)\.(\d+)').search 13 15 cursor = connection.cursor() 14 16 cursor.execute("SELECT version()") 15 self._postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]17 self._postgres_version = map(int, version_search(cursor.fetchone()[0]).groups()) 16 18 return self._postgres_version 17 19 postgres_version = property(_get_postgres_version) 18 20