Ensure that the import/export feature should work with SSH Tunnel. Fixes #5739

pull/35/head
Pradip Parkale 2020-09-22 09:40:59 +05:30 committed by Akshay Joshi
parent ed3c692b1f
commit 1ee9cddceb
2 changed files with 7 additions and 2 deletions

View File

@ -18,6 +18,7 @@ Bug fixes
*********
| `Issue #5417 <https://redmine.postgresql.org/issues/5417>`_ - Fixed and improve API test cases for the schema diff tool.
| `Issue #5739 <https://redmine.postgresql.org/issues/5739>`_ - Ensure that the import/export feature should work with SSH Tunnel.
| `Issue #5802 <https://redmine.postgresql.org/issues/5802>`_ - Remove maximum length on the password field in the server dialog.
| `Issue #5807 <https://redmine.postgresql.org/issues/5807>`_ - Fixed an issue where a column is renamed and then removed, then the drop SQL query takes the wrong column name.
| `Issue #5830 <https://redmine.postgresql.org/issues/5830>`_ - Fixed reverse engineering SQL where parenthesis is not properly arranged for View/MView definition.

View File

@ -342,8 +342,12 @@ def create_import_export_job(sid):
manager.export_password_env(p.id)
env = dict()
env['PGHOST'] = server.host
env['PGPORT'] = str(server.port)
env['PGHOST'] = \
manager.local_bind_host if manager.use_ssh_tunnel else server.host
env['PGPORT'] = \
str(manager.local_bind_port) if manager.use_ssh_tunnel else str(
server.port)
env['PGUSER'] = server.username
env['PGDATABASE'] = data['database']
p.set_env_variables(server, env=env)