Fixed an issue where the database server is not connected using a service file. #5889

This commit is contained in:
Akshay Joshi 2023-02-28 13:29:42 +05:30
parent 1c0b826d23
commit a008f9ba79
4 changed files with 10 additions and 4 deletions

View File

@ -44,5 +44,7 @@ Bug fixes
| `Issue #5803 <https://github.com/pgadmin-org/pgadmin4/issues/5803>`_ - Fix an issue where query tool is stripping spaces in grid cell.
| `Issue #5810 <https://github.com/pgadmin-org/pgadmin4/issues/5810>`_ - Fix an issue where sequence owner is remove on sequence edit.
| `Issue #5822 <https://github.com/pgadmin-org/pgadmin4/issues/5822>`_ - Do not allow to save invalid JSON in query tool JSON editor.
| `Issue #5833 <https://github.com/pgadmin-org/pgadmin4/issues/5833>`_ - Fixed an issue where user MFA entry was not getting delete after deleting a user.
| `Issue #5847 <https://github.com/pgadmin-org/pgadmin4/issues/5847>`_ - Fixed an issue where pgAdmin failed to connect when the Postgres password included special characters.
| `Issue #5872 <https://github.com/pgadmin-org/pgadmin4/issues/5872>`_ - Handle MERGE operation in query tool explain introduced in PostgreSQL 15.
| `Issue #5889 <https://github.com/pgadmin-org/pgadmin4/issues/5889>`_ - Fixed an issue where the database server is not connected using a service file.

View File

@ -641,6 +641,8 @@ WHERE db.oid = {0}""".format(did))
self.local_bind_port if self.use_ssh_tunnel else self.port
dsn_args['dbname'] = database
dsn_args['user'] = user
if self.service is not None:
dsn_args['service'] = self.service
# Make a copy to display the connection string on GUI.
display_dsn_args = dsn_args.copy()
@ -657,7 +659,7 @@ WHERE db.oid = {0}""".format(did))
orig_value = value
# Getting complete file path if the key is one of the below.
if key in ['passfile', 'sslcert', 'sslkey', 'sslrootcert',
'sslcrl', 'service', 'sslcrldir']:
'sslcrl', 'sslcrldir']:
with_complete_path = True
value = get_complete_file_path(value)

View File

@ -268,7 +268,7 @@ class Connection(BaseConnection):
password, encpass, is_update_password = self._check_user_password(
kwargs)
passfile = manager.get_connection_param_value('passfile')
passfile = kwargs['passfile'] if 'passfile' in kwargs else None
tunnel_password = kwargs['tunnel_password'] if 'tunnel_password' in \
kwargs else ''
@ -305,7 +305,7 @@ class Connection(BaseConnection):
# we will check for pgpass file availability from connection manager
# if it's present then we will use it
if not password and not encpass and not passfile:
passfile = manager.passfile if manager.passfile else None
passfile = manager.get_connection_param_value('passfile')
if manager.passexec:
password = manager.passexec.get()

View File

@ -642,6 +642,8 @@ WHERE db.oid = {0}""".format(did))
self.local_bind_port if self.use_ssh_tunnel else self.port
dsn_args['dbname'] = database
dsn_args['user'] = user
if self.service is not None:
dsn_args['service'] = self.service
# Make a copy to display the connection string on GUI.
display_dsn_args = dsn_args.copy()
@ -658,7 +660,7 @@ WHERE db.oid = {0}""".format(did))
orig_value = value
# Getting complete file path if the key is one of the below.
if key in ['passfile', 'sslcert', 'sslkey', 'sslrootcert',
'sslcrl', 'service', 'sslcrldir']:
'sslcrl', 'sslcrldir']:
with_complete_path = True
value = get_complete_file_path(value)