Code

Opened 6 years ago

Closed 6 years ago

#6433 closed (fixed)

postgres backend doesn't accept version number 8.3RC2

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

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 6 years ago.
postgres-funny-version2.diff (866 bytes) - added by trevor 6 years ago.
postgres_version_fix.diff (1.3 KB) - added by brettp 6 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 jerickso 6 years ago.
A new patch that works with RC/beta versions and Windows version strings

Download all attachments as: .zip

Change History (15)

Changed 6 years ago by trevor

comment:1 Changed 6 years ago by tvrg

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #6236.

comment:2 Changed 6 years ago by Simon Greenhill <dev@…>

  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Triage Stage changed from Unreviewed to Ready for checkin

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

comment:3 Changed 6 years ago 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.

comment:4 Changed 6 years ago by ubernostrum

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

Reverting status per above comment.

Changed 6 years ago by trevor

comment:5 Changed 6 years ago by trevor

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

Changed 6 years ago by brettp

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

comment:6 Changed 6 years ago by brettp

  • Patch needs improvement unset

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

comment:7 Changed 6 years ago by jerickso

  • Owner changed from nobody to jerickso
  • Status changed from reopened to new

comment:8 Changed 6 years ago 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.

Changed 6 years ago by jerickso

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

comment:9 Changed 6 years ago by jerickso

  • Triage 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).

comment:10 Changed 6 years ago 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.

comment:11 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.