Skip to content

Commit 8b5ee92

Browse files
committed
Merge branch 'pgpro_edition_fix' of https://git.postgrespro.ru/a.alekseev/mamonsu
2 parents 974e77a + 3b13409 commit 8b5ee92

File tree

1 file changed

+8
-4
lines changed
  • mamonsu/plugins/pgsql/driver

1 file changed

+8
-4
lines changed

mamonsu/plugins/pgsql/driver/pool.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import mamonsu.lib.platform as platform
22
from distutils.version import LooseVersion
3-
from connection import Connection, ConnectionInfo
3+
from .connection import Connection, ConnectionInfo
44

55

66
class Pool(object):
@@ -127,9 +127,13 @@ def is_pgpro_ee(self, db=None):
127127
return False
128128
if db in self._cache['pgproee']:
129129
return self._cache['pgproee'][db]
130-
self._cache['pgproee'][db] = (
131-
self.query('select pgpro_edition()')[0][0].lower() == 'enterprise'
132-
)
130+
try:
131+
ed = self.query('select pgpro_edition()')[0][0]
132+
self._connections[db].log.info('pgpro_edition is {}'.format(ed))
133+
self._cache['pgproee'][db] = (ed.lower() == 'enterprise')
134+
except:
135+
self._connections[db].log.info('pgpro_edition() is not defined')
136+
self._cache['pgproee'][db] = False
133137
return self._cache['pgproee'][db]
134138

135139
def extension_installed(self, ext, db=None):

0 commit comments

Comments
 (0)