Django

Code

Ticket #6954 (closed: duplicate)

Opened 8 months ago

Last modified 8 months ago

PostgreSQL version test is fragile

Reported by: leosoto Assigned to: nobody
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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)

Attachments

Change History

04/08/08 18:55:50 changed by russellm

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to duplicate.
  • needs_tests changed.
  • needs_docs changed.

Essentially a dupe of #6433.


Add/Change #6954 (PostgreSQL version test is fragile)




Change Properties
Action