#8737 closed (fixed)
PostgreSQL version detection is fragile; no longer works for EnterpriseDB
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.0 |
| Severity: | Keywords: | postgresql, enterprisedb, version | |
| Cc: | fawad@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
It appears that line 16 in /db/backends/postgresql/versions.py breaks the PostgreSQL version detection for EnterpriseDB. The error returned is
File "/usr/lib/python2.5/site-packages/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'
Changing
VERSION_RE = re.compile(r'PostgreSQL (\d+)\.(\d+)\.')
to
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.')
makes it work for both PostgreSQL and EnterpriseDB.
Attachments (1)
Change History (8)
comment:1 by , 17 years ago
| Version: | SVN → 1.0 |
|---|
comment:2 by , 17 years ago
| Has patch: | set |
|---|
comment:3 by , 17 years ago
| Cc: | added |
|---|---|
| Patch needs improvement: | set |
I'm running PostgreSQL 8.3 beta4, so had to modify the regular expression above to
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)(?:\.|beta(?:\d+))')
comment:5 by , 17 years ago
| milestone: | → 1.1 |
|---|---|
| Summary: | PostgreSQL version detection no longer works for EnterpriseDB → PostgreSQL version detection is fragile; no longer works for EnterpriseDB |
| Triage Stage: | Unreviewed → Accepted |
comment:6 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I have the same issue with Django 1.0 + Postgresql 7.4. My app was working with a spring 2008 SVN checkout, and broke with the same error message as the original poster when upgrading to 1.0. The suggested RE change fixes it for me.