Skip to content

Commit 2b58903

Browse files
committed
pgpro_edition fix
1 parent b993751 commit 2b58903

File tree

1 file changed

+7
-3
lines changed
  • mamonsu/plugins/pgsql/driver

1 file changed

+7
-3
lines changed

mamonsu/plugins/pgsql/driver/pool.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)