Opened 8 years ago

Closed 8 years ago

#6954 closed (duplicate)

PostgreSQL version test is fragile

Reported by: Leo Soto M. Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

On source:django/trunk/django/db/backends/postgresql/operations.py, _get_postgres_version does the following:

cursor.execute("SELECT version()")
self._postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]

But that fails with some PostgreSQL installations on win32, where version() gives:

PostgreSQL 8.3.1, compiled by Visual C++ build 1400

So the last split() returns ['8', '3', '1,']. And int('1,') obviously fails.

This renders Django+PostgreSQL unusable on some installations (at least with Django 0.96)

Change History (1)

comment:1 Changed 8 years ago by Russell Keith-Magee

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

Essentially a dupe of #6433.

Note: See TracTickets for help on using tickets.
Back to Top