From 856c93c33871ef5cb059bf5318d5698dada914e0 Mon Sep 17 00:00:00 2001 From: Kristjan Date: Sun, 6 Oct 2019 17:13:39 +0200 Subject: [PATCH] Fix Postgis version check (#23) (h/t [Krizz](https://github.com/Krizz)) Fixes Postgis version check to allow Beta/RC versions --- src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index beef89ae..eefa9771 100755 --- a/src/db.rs +++ b/src/db.rs @@ -25,7 +25,7 @@ pub fn select_postgis_verion(pool: &PostgresPool) -> io::Result { .map_err(|err| io::Error::new(io::ErrorKind::Other, err.description()))?; let version: String = conn - .query("select postgis_lib_version()", &[]) + .query(r#"select (regexp_matches(postgis_lib_version(), '^(\d+\.\d+\.\d+)', 'g'))[1] as postgis_lib_version"#, &[]) .map(|rows| rows.get(0).get("postgis_lib_version"))?; Ok(version)