Author: William Grzybowski <william@grzy.org>
        Marten Karl <marten.karl@milkbar.tips>
Subject: Fix for debian suffix on pg_config --version
Bug-Debian: http://bugs.debian.org/890646
Last-Update: 2019-07-12
--- py-postgresql.orig/postgresql/installation.py	2019-07-12 11:46:27.948227402 -0300
+++ py-postgresql/postgresql/installation.py	2019-07-12 11:47:31.237045279 -0300
@@ -212,7 +212,7 @@
 		"""
 		self.info = info
 		self.version = self.info["version"]
-		self.type, vs = self.version.split()
+		self.type, vs = self.version.split()[:2]
 		self.version_info = versionstring.normalize(versionstring.split(vs))
 		self.configure_options = dict(
 			parse_configure_options(self.info.get('configure', ''))
--- py-postgresql.orig/postgresql/versionstring.py
+++ py-postgresql/postgresql/versionstring.py
@@ -15,7 +15,7 @@ def split(vstr : str) -> (
 	Split a PostgreSQL version string into a tuple
 	(major,minor,patch,...,state_class,state_level)
 	"""
-	v = vstr.strip().split('.')
+	v = vstr.strip().split(' ')[0].split('.')
 
 	# Get rid of the numbers around the state_class (beta,a,dev,alpha, etc)
 	state_class = v[-1].strip('0123456789')
