Opened 16 years ago

Closed 16 years ago

#6954 closed (duplicate)

PostgreSQL version test is fragile

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

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 by Russell Keith-Magee, 16 years ago

Resolution: duplicate
Status: newclosed

Essentially a dupe of #6433.

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