From ab2cadff24f58c933b2c6afd29604c5e938eb8c7 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 30 Nov 2018 15:38:31 +0100 Subject: [PATCH] Simplify the regular expresion parsing the PostgreSQL version string. The debian/Ubuntu packaging would defeat the quite simple regexp parsing PostgreSQL version string that we have in pgloader. To make it more robust, make it more open to unforeseen strings. See #800, see #810. --- src/pgsql/connection.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pgsql/connection.lisp b/src/pgsql/connection.lisp index 9896559..404b451 100644 --- a/src/pgsql/connection.lisp +++ b/src/pgsql/connection.lisp @@ -410,10 +410,11 @@ ;;; ;;; PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.2058 ;;; PostgreSQL 10.1 on x86_64-apple-darwin14.5.0, compiled by Apple LLVM version 7.0.0 (clang-700.1.76), 64-bit +;;; PostgreSQL 10.6 (Ubuntu 10.6-1.pgdg14.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit (defun parse-postgresql-version-string (version-string) "Parse PostgreSQL select version() output." (cl-ppcre:register-groups-bind (full-version maybe-variant) - ("PostgreSQL ([0-9.]+) on .*, [^,]+, (.*)" version-string) + ("PostgreSQL ([0-9.]+) [^,]+, [^,]+, (.*)" version-string) (let* ((version-dots (split-sequence:split-sequence #\. full-version)) (major-version (if (= 3 (length version-dots)) (format nil "~a.~a"