diff --git a/docs/en_US/backup_dialog.rst b/docs/en_US/backup_dialog.rst index 486caa9a9..e3bc0d44a 100644 --- a/docs/en_US/backup_dialog.rst +++ b/docs/en_US/backup_dialog.rst @@ -203,8 +203,28 @@ tab related to tables that should be included in the backup. * Move the switch next to *With OIDs* towards right position to include object identifiers as part of the table data for each table. + * Use the *Table and Children* field to dump the tables and any partitions + or inheritance child tables of the tables matching the table pattern. Multiple patterns + can be given separated by space. **Note:** This option is visible only + for database server greater than or equal to 16. + + * Use the *Exclude table* field to not dump the tables matching the table + pattern. Multiple patterns can be given separated by space. + * Use the *Exclude table data* field to not dump data for any tables - matching the table pattern. + matching the table pattern. Multiple patterns can be given separated by + spaces. + + * Use the *Exclude table and children* field to not dump the tables and any + partitions or inheritance child tables of the tables matching the table + pattern. Multiple patterns can be given separated by space. **Note:** This + option is visible only for database server greater than or equal to 16. + + * Use the *Exclude table data and children* field to not dump data for the + tables and any partitions or inheritance child tables of the tables matching + the table pattern. Multiple patterns can be given separated by space. + **Note:** This option is visible only for database server greater than or + equal to 16. Click the *Options* tab to continue. Use the fields in the *Options* tab to provide other backup options. diff --git a/docs/en_US/images/backup_table.png b/docs/en_US/images/backup_table.png index 60033dab9..2e5a717de 100644 Binary files a/docs/en_US/images/backup_table.png and b/docs/en_US/images/backup_table.png differ diff --git a/web/pgadmin/tools/backup/__init__.py b/web/pgadmin/tools/backup/__init__.py index f14059da8..c651cd29c 100644 --- a/web/pgadmin/tools/backup/__init__.py +++ b/web/pgadmin/tools/backup/__init__.py @@ -327,6 +327,7 @@ def _get_args_params_values(data, conn, backup_obj_type, backup_file, server, set_value('exclude_table_data_and_children', '--exclude-table-data-and-children', None, manager.version >= 160000) + set_value('exclude_table', '--exclude-table') # Disable options set_param('disable_trigger', '--disable-triggers', diff --git a/web/pgadmin/tools/backup/static/js/backup.ui.js b/web/pgadmin/tools/backup/static/js/backup.ui.js index b7bedc894..72a53ec7b 100644 --- a/web/pgadmin/tools/backup/static/js/backup.ui.js +++ b/web/pgadmin/tools/backup/static/js/backup.ui.js @@ -658,13 +658,6 @@ export default class BackupSchema extends BaseUISchema { } return false; }, - }, { - id: 'exclude_table_data', - label: gettext('Exclude table data'), - type: 'text', - disabled: false, - group: gettext('Table Options'), - visible: isVisibleForServerBackup(obj.backupType) }, { id: 'table_and_children', label: gettext('Table and Children'), @@ -673,6 +666,20 @@ export default class BackupSchema extends BaseUISchema { group: gettext('Table Options'), min_version: 160000, visible: isVisibleForServerBackup(obj.backupType) + }, { + id: 'exclude_table', + label: gettext('Exclude table'), + type: 'text', + disabled: false, + group: gettext('Table Options'), + visible: isVisibleForServerBackup(obj.backupType) + }, { + id: 'exclude_table_data', + label: gettext('Exclude table data'), + type: 'text', + disabled: false, + group: gettext('Table Options'), + visible: isVisibleForServerBackup(obj.backupType) }, { id: 'exclude_table_and_children', label: gettext('Exclude table and children'), diff --git a/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py b/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py index 99a158b7d..8197942ad 100644 --- a/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py +++ b/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py @@ -708,6 +708,31 @@ class BackupCreateJobTest(BaseTestGenerator): message='--large-objects is not supported by EPAS/PG server ' 'less than 16' )), + ('When backup the object with option - Exclude table', + dict( + class_params=dict( + sid=1, + name='test_backup_server', + port=5444, + host='localhost', + database='postgres', + bfile='test_backup', + username='postgres' + ), + params=dict( + file='test_backup_file', + format='custom', + verbose=True, + schemas=[], + tables=[], + database='postgres', + exclude_table="table1" + ), + url=BACKUP_OBJECT_URL, + expected_cmd_opts=['--exclude-table', 'table1'], + not_expected_cmd_opts=[], + expected_exit_code=[0, None] + )), ('When backup a schema with default options (< v16)', dict( class_params=dict(