]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Parse for Postgresql version w/ "beta"
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Jun 2017 16:30:22 +0000 (12:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 8 Jun 2017 17:01:29 +0000 (13:01 -0400)
Continuing with the fix that correctly handles Postgresql
version string "10devel" released in 1.1.8, an additional regexp
bump to handle version strings of the form "10beta1".   While
Postgresql now offers better ways to get this information, we
are sticking w/ the regexp at least through 1.1.x for the least
amount of risk to compatibility w/ older or alternate Postgresql
databases.

Change-Id: I12ddb06465f7dcf80563c27632441ef5963f60d4
Fixes: #4005
(cherry picked from commit b6d3f60791834ead92564fc58afebc2c3eb4a2ff)

doc/build/changelog/changelog_11.rst
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_dialect.py

index 6f891c47cc850b61ef111be05b24cbc86d621acf..81c80abb85b1501db78579b24c67f3ea9734cd81 100644 (file)
 .. changelog::
     :version: 1.1.11
 
+    .. change:: 4005
+        :tags: bug, postgresql
+        :tickets: 4005
+        :versions: 1.2.0b1
+
+        Continuing with the fix that correctly handles Postgresql
+        version string "10devel" released in 1.1.8, an additional regexp
+        bump to handle version strings of the form "10beta1".   While
+        Postgresql now offers better ways to get this information, we
+        are sticking w/ the regexp at least through 1.1.x for the least
+        amount of risk to compatibility w/ older or alternate Postgresql
+        databases.
+
     .. change:: 3994
         :tags: bug, mssql
         :tickets: 3994
index 1d6951c2320b7741077d9cd4f3e2ca5fbe339ab8..5f10ab9a9fa40e53f8156c72ba8751e875a5e5b6 100644 (file)
@@ -2291,7 +2291,7 @@ class PGDialect(default.DefaultDialect):
         v = connection.execute("select version()").scalar()
         m = re.match(
             r'.*(?:PostgreSQL|EnterpriseDB) '
-            r'(\d+)\.?(\d+)?(?:\.(\d+))?(?:\.\d+)?(?:devel)?',
+            r'(\d+)\.?(\d+)?(?:\.(\d+))?(?:\.\d+)?(?:devel|beta)?',
             v)
         if not m:
             raise AssertionError(
index c79b186de074da872d21a2172e73fe2834ca1532..376ba081cf29bf921cb42c95e688d7187ea7a6ad 100644 (file)
@@ -63,7 +63,12 @@ class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
                     'release build 1080137', (9, 2, 4)),
                 (
                     'PostgreSQL 10devel on x86_64-pc-linux-gnu'
-                    'compiled by gcc (GCC) 6.3.1 20170306, 64-bit', (10,))]:
+                    'compiled by gcc (GCC) 6.3.1 20170306, 64-bit', (10,)),
+                (
+                    'PostgreSQL 10beta1 on x86_64-pc-linux-gnu, '
+                    'compiled by gcc (GCC) 4.8.5 20150623 '
+                    '(Red Hat 4.8.5-11), 64-bit', (10,))
+        ]:
             eq_(testing.db.dialect._get_server_version_info(mock_conn(string)),
                 version)