mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Only allow specification of a pgpass file if libpq >= 10. Fixes #2768
This commit is contained in:
committed by
Dave Page
parent
63103c7a48
commit
2f5a2b2392
@@ -32,6 +32,9 @@ class BaseDriver(object):
|
||||
* Version (string):
|
||||
Current version string for the database server
|
||||
|
||||
* libpq_version (string):
|
||||
Current version string for the used libpq library
|
||||
|
||||
Abstract Methods:
|
||||
-------- -------
|
||||
* get_connection(*args, **kwargs)
|
||||
@@ -51,6 +54,10 @@ class BaseDriver(object):
|
||||
def Version(cls):
|
||||
pass
|
||||
|
||||
@abstractproperty
|
||||
def libpq_version(cls):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_connection(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
@@ -2043,6 +2043,18 @@ class Driver(BaseDriver):
|
||||
"Driver Version information for psycopg2 is not available!"
|
||||
)
|
||||
|
||||
def libpq_version(cls):
|
||||
"""
|
||||
Returns the loaded libpq version
|
||||
"""
|
||||
version = getattr(psycopg2, '__libpq_version__', None)
|
||||
if version:
|
||||
return version
|
||||
|
||||
raise Exception(
|
||||
"libpq version information is not available!"
|
||||
)
|
||||
|
||||
def get_connection(
|
||||
self, sid, database=None, conn_id=None, auto_reconnect=True
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user