From 8005b0529227ca8fbbb1252475c5a4ec9fcc5330 Mon Sep 17 00:00:00 2001 From: Maxim Zakharov Date: Fri, 31 Mar 2017 13:03:25 +0530 Subject: [PATCH] Fixes #2304, #2145 - Resolve the issue for restoring the table from the backup. Earlier - implementation was generating the backup code like as below: XXX/pg_restore.exe --host "x.x.x.x" --port "xxxx" --username "osboxes" --no-password --dbname "test" --data-only --verbose --table "tt.test2" "XXX-FILE.bak" It should have been: XXX/pg_restore.exe --host "x.x.x.x" --port "xxxx" --username "osboxes" --no-password --dbname "test" --data-only --verbose --schema "tt" --table "test2" "XXX-FILE.bak" --- web/pgadmin/tools/restore/__init__.py | 10 +++++----- .../restore/templates/restore/js/restore.js | 17 +++++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/web/pgadmin/tools/restore/__init__.py b/web/pgadmin/tools/restore/__init__.py index 393639bde..c27e4a624 100644 --- a/web/pgadmin/tools/restore/__init__.py +++ b/web/pgadmin/tools/restore/__init__.py @@ -303,11 +303,11 @@ def create_restore_job(sid): set_param('verbose', '--verbose') set_multiple('schemas', '--schema', False) - set_multiple('tables', '--table') - set_multiple('functions', '--function') - set_multiple('triggers', '--trigger') - set_multiple('trigger_funcs', '--function') - set_multiple('indexes', '--index') + set_multiple('tables', '--table', False) + set_multiple('functions', '--function', False) + set_multiple('triggers', '--trigger', False) + set_multiple('trigger_funcs', '--function', False) + set_multiple('indexes', '--index', False) args.append(fs_short_path(_file)) diff --git a/web/pgadmin/tools/restore/templates/restore/js/restore.js b/web/pgadmin/tools/restore/templates/restore/js/restore.js index b76927c08..df3e1935a 100644 --- a/web/pgadmin/tools/restore/templates/restore/js/restore.js +++ b/web/pgadmin/tools/restore/templates/restore/js/restore.js @@ -484,22 +484,27 @@ define([ if (!m.get('custom')) { switch (d._type) { case 'schema': - m.set('schemas', d._label); + m.set('schemas', [d._label]); break; case 'table': - m.set('tables', [info.schema._label, d._label]); + m.set('schemas', [info.schema._label]); + m.set('tables', [d._label]); break; case 'function': - m.set('functions', [info.schema._label, d._label]); + m.set('schemas', [info.schema._label]); + m.set('functions', [d._label]); break; case 'index': - m.set('indexes', [info.schema._label, d._label]); + m.set('schemas', [info.schema._label]); + m.set('indexes', [d._label]); break; case 'trigger': - m.set('triggers', [info.schema._label, d._label]); + m.set('schemas', [info.schema._label]); + m.set('triggers', [d._label]); break; case 'trigger_func': - m.set('trigger_funcs', [info.schema._label, d._label]); + m.set('schemas', [info.schema._label]); + m.set('trigger_funcs', [d._label]); break; } } else {