#10842: Django 1.0.2 generates AttributeError with PostgreSql 8.4beta1
------------------------------------------+---------------------------------
 Reporter:  hgdeoro                       |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:  postgresql                    |       Stage:  Unreviewed
Has_patch:  1                             |  
------------------------------------------+---------------------------------
 I get this exception with Django 1.0.2 + PostgrsSql 8.4 beta1 (compiled
 from source):
 {{{
   File "/path/to/project/Django-1.0.2/django/db/backends/__init__.py",
 line 56, in cursor
     cursor = self._cursor(settings)
   File
 "/path/to/project/Django-1.0.2/django/db/backends/postgresql_psycopg2/base.py",
 line 92, in _cursor
     self.__class__._version = get_version(cursor)
   File
 "/path/to/project/Django-1.0.2/django/db/backends/postgresql/version.py",
 line 16, in get_version
     major, minor = VERSION_RE.search(version).groups()
 AttributeError: 'NoneType' object has no attribute 'groups'
 }}}

 The problem is the RE used on django/db/backends/postgresql/version.py
 (django-1.0.2):
 {{{
 VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\.')
 }}}

 When asked for the version, PostgreSql 8.4beta1 returns:
 '''PostgreSQL 8.4beta1 on i686-pc-linux-gnu, compiled by GCC gcc (Ubuntu
 4.3.2-1ubuntu12) 4.3.2, 32-bit'''

 The RE used in Django 1.1 works OK:
 {{{
 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)')
 }}}

 (the '\S+' is used to support EnterpriseDB, see ticket #8737).

 I think django/db/backends/postgresql/operations.py (django-1.0.2) should
 be modifyed too to make it compatible with EnterpriseDB.

 Both files (version.py and operations.py) could be patched with
 fix_re_django-1.0.2.diff.
 I've also attached fix_re_django-1.1-dev.diff that changes operations.py
 to support EnterpriseDB.

 Other tickets (already closed) related to this are: #6433 #9931 #9953

 I've tested that the patches are working against PostgreSQL 8.3 (Ubuntu
 8.10) and PostgreSQL 8.4beta1 (from sources) but haven't check that those
 changes works well with EnterpriseDB.

 Thanks!

 Horacio

 Related post: http://groups.google.com/group/django-
 developers/browse_thread/thread/7826f83429487a07

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10842>
Django <http://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 post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to