Django

Code

Ticket #6433 (closed: fixed)

Opened 9 months ago

Last modified 6 months ago

postgres backend doesn't accept version number 8.3RC2

Reported by: trevor Assigned to: jerickso
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

the postgres backend expects the parts of the postgres version number as reported by select version() to be both integers. however this is not always the case:

trevor=> select version();
                                                     version                                                     
-----------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.3RC2 on x86_64-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)
(1 row)

the fix is trivial, however. see attached.

Attachments

odd-version-string-fix.diff (0.7 kB) - added by trevor on 01/21/08 06:20:08.
postgres-funny-version2.diff (0.8 kB) - added by trevor on 01/29/08 22:57:38.
postgres_version_fix.diff (1.3 kB) - added by brettp on 02/06/08 09:21:24.
Patch for postgres version that keeps with previous behaviour on "regular" version numbers and works with beta/RC versions
postgres-versions.diff (1.4 kB) - added by jerickso on 04/09/08 18:44:49.
A new patch that works with RC/beta versions and Windows version strings

Change History

01/21/08 06:20:08 changed by trevor

  • attachment odd-version-string-fix.diff added.

01/21/08 10:57:30 changed by tvrg

  • status changed from new to closed.
  • resolution set to duplicate.

duplicate of #6236.

01/21/08 19:27:28 changed by Simon Greenhill <dev@simon.net.nz>

  • status changed from closed to reopened.
  • resolution deleted.
  • stage changed from Unreviewed to Ready for checkin.

I'll reopen this one in favor of #6236, as this has a patch already.

01/23/08 16:48:52 changed by brettp

The patch has a small issue in that with the string suggested in the ticket you'd get a postgres_version of [8, 33] which is, err, obviously wrong, though I'm not entirely sure what the correct answer would be to that - if we could gaurantee that the string RC was going to be in the RC versions, then we could do a check for RC in the version string, then take one off the version before it.

Otherwise, we could just ditch anything after the first character that's not a digit or a period, then parse that, which would give [8, 3] in this case. That might be a better solution.

01/23/08 20:20:31 changed by ubernostrum

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.

Reverting status per above comment.

01/29/08 22:57:38 changed by trevor

  • attachment postgres-funny-version2.diff added.

01/29/08 22:59:30 changed by trevor

This patch just grabs the first \d+\.\d+ in select version() and calls that the version number.

02/06/08 09:21:24 changed by brettp

  • attachment postgres_version_fix.diff added.

Patch for postgres version that keeps with previous behaviour on "regular" version numbers and works with beta/RC versions

02/14/08 06:49:55 changed by brettp

  • needs_better_patch deleted.

Removed patch-need-improvement property as there's a new patch that hasn't been reviewed yet.

03/18/08 11:23:17 changed by jerickso

  • owner changed from nobody to jerickso.
  • status changed from reopened to new.

04/08/08 18:56:45 changed by russellm

This problem has been duplicated as #6987 and #6954; these reports are about the release veresion of the 8.3 version number for Windows builds. #6987 contains a patch that might be useful.

04/09/08 18:44:49 changed by jerickso

  • attachment postgres-versions.diff added.

A new patch that works with RC/beta versions and Windows version strings

04/09/08 18:48:47 changed by jerickso

  • stage changed from Accepted to Ready for checkin.

Attached file postgres-versions.diff, modeled very similarly after the MySQL version check, that works for the windows version string as well as if the version string does not have a patch level (like in the above mentioned example).

04/12/08 21:03:14 changed by mtredinnick

I don't have any way to test this on Windows or an 8.3 beta version, but it looks fairly correct, so I'll commit a small variation on it and we can sort out the damage as people use it.

04/12/08 21:04:11 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [7415]) Fixed #6433 -- Handle some varied PostgreSQL version strings (beta versions and Windows version strings). Patch from jerickso.


Add/Change #6433 (postgres backend doesn't accept version number 8.3RC2)




Change Properties
Action