Opened 17 years ago

Closed 17 years ago

#6433 closed (fixed)

postgres backend doesn't accept version number 8.3RC2

Reported by: Trevor Caira Owned by: Jason Erickson
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (4)

odd-version-string-fix.diff (754 bytes ) - added by Trevor Caira 17 years ago.
postgres-funny-version2.diff (866 bytes ) - added by Trevor Caira 17 years ago.
postgres_version_fix.diff (1.3 KB ) - added by brettp 17 years ago.
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 Jason Erickson 17 years ago.
A new patch that works with RC/beta versions and Windows version strings

Download all attachments as: .zip

Change History (15)

by Trevor Caira, 17 years ago

Attachment: odd-version-string-fix.diff added

comment:1 by Tom Vergote, 17 years ago

Resolution: duplicate
Status: newclosed

duplicate of #6236.

comment:2 by Simon Greenhill <dev@…>, 17 years ago

Resolution: duplicate
Status: closedreopened
Triage Stage: UnreviewedReady for checkin

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

comment:3 by brettp, 17 years ago

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.

comment:4 by James Bennett, 17 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Reverting status per above comment.

by Trevor Caira, 17 years ago

comment:5 by Trevor Caira, 17 years ago

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

by brettp, 17 years ago

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

comment:6 by brettp, 17 years ago

Patch needs improvement: unset

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

comment:7 by Jason Erickson, 17 years ago

Owner: changed from nobody to Jason Erickson
Status: reopenednew

comment:8 by Russell Keith-Magee, 17 years ago

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.

by Jason Erickson, 17 years ago

Attachment: postgres-versions.diff added

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

comment:9 by Jason Erickson, 17 years ago

Triage Stage: AcceptedReady 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).

comment:10 by Malcolm Tredinnick, 17 years ago

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.

comment:11 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

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

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