Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/en_US/backup_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg
* Move the switch next to *Only schemas* to limit the back up to schema-level
database objects.

* Move the switch next to *Only statistics* to the *Yes* position to limit
the back up to optimizer statistics. **Note:** This option is visible only
for database server greater than or equal to 18.

* Move the switch next to *Blobs* to the *No* position to exclude large
objects in the backup.

Expand Down Expand Up @@ -143,6 +147,22 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg
Table access methods. **Note:** This option is visible only for
database server greater than or equal to 15.

* Move the switch next to *Row security policies* to the *Yes* position to
exclude row security policies. **Note:** This option is visible only for
database server greater than or equal to 18.

* Move the switch next to *Data* to the *Yes* position to exclude data from
the backup. **Note:** This option is visible only for database server
greater than or equal to 18.

* Move the switch next to *Schema* to the *Yes* position to exclude schema
(the data definitions) from the backup. **Note:** This option is visible
only for database server greater than or equal to 18.

* Move the switch next to *Statistics* to the *Yes* position to exclude
optimizer statistics. **Note:** This option is visible only for database
server greater than or equal to 18.

.. image:: images/backup_queries.png
:alt: Queries option on backup dialog
:align: center
Expand Down Expand Up @@ -259,6 +279,14 @@ tab to provide other backup options.
position to include a statement that will use a SET SESSION AUTHORIZATION
command to determine object ownership (instead of an ALTER OWNER command).

* Move the switch next to *Dump statistics* to the *Yes* position to include
optimizer statistics in the backup. **Note:** This option is visible only
for database server greater than or equal to 18.

* Move the switch next to *Sequence data* to the *Yes* position to include
sequence data that would normally be excluded. **Note:** This option is
visible only for database server greater than or equal to 18.

* Use the *Exclude schema* field to not dump schemas whose name matches
pattern.

Expand Down
28 changes: 28 additions & 0 deletions docs/en_US/backup_server_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg

* Move the switch next to *Only roles* to limit the back up to roles only.

* Move the switch next to *Only statistics* to the *Yes* position to limit
the back up to optimizer statistics. **Note:** This option is visible only
for database server greater than or equal to 18.

.. image:: images/backup_server_do_not_save.png
:alt: Do not save option on backup server dialog
:align: center
Expand Down Expand Up @@ -88,6 +92,22 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg
Table access methods. **Note:** This option is visible only for
database server greater than or equal to 15.

* Move the switch next to *Row security policies* to the *Yes* position to
exclude row security policies. **Note:** This option is visible only for
database server greater than or equal to 18.

* Move the switch next to *Data* to the *Yes* position to exclude data from
the backup. **Note:** This option is visible only for database server
greater than or equal to 18.

* Move the switch next to *Schema* to the *Yes* position to exclude schema
(the data definitions) from the backup. **Note:** This option is visible
only for database server greater than or equal to 18.

* Move the switch next to *Statistics* to the *Yes* position to exclude
optimizer statistics. **Note:** This option is visible only for database
server greater than or equal to 18.

.. image:: images/backup_server_queries.png
:alt: Queries option on backup server dialog
:align: center
Expand Down Expand Up @@ -171,6 +191,14 @@ tab to provide other backup options.
position to include a statement that will use a SET SESSION AUTHORIZATION
command to determine object ownership (instead of an ALTER OWNER command).

* Move the switch next to *Dump statistics* to the *Yes* position to include
optimizer statistics in the backup. **Note:** This option is visible only
for database server greater than or equal to 18.

* Move the switch next to *Sequence data* to the *Yes* position to include
sequence data that would normally be excluded. **Note:** This option is
visible only for database server greater than or equal to 18.

* Use the *Exclude database* field to not dump databases whose name matches
pattern.

Expand Down
20 changes: 20 additions & 0 deletions docs/en_US/restore_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg
* Move the switch next to *Only schema* to limit the restoration to
schema-level database objects.

* Move the switch next to *Only statistics* to the *Yes* position to limit
the restoration to optimizer statistics. **Note:** This option is visible
only for database server greater than or equal to 18.

.. image:: images/restore_do_not_save.png
:alt: Restore dialog do not save section
:align: center
Expand Down Expand Up @@ -110,6 +114,22 @@ tab to provide options related to data or pgAdmin objects that correspond to *pg
Table access methods. **Note:** This option is visible only for
database server greater than or equal to 15.

* Move the switch next to *Row security policies* to the *Yes* position to
exclude row security policies. **Note:** This option is visible only for
database server greater than or equal to 18.

* Move the switch next to *Data* to the *Yes* position to exclude data from
the restore. **Note:** This option is visible only for database server
greater than or equal to 18.

* Move the switch next to *Schema* to the *Yes* position to exclude schema
(the data definitions) from the restore. **Note:** This option is visible
only for database server greater than or equal to 18.

* Move the switch next to *Statistics* to the *Yes* position to exclude
optimizer statistics from the restore. **Note:** This option is visible
only for database server greater than or equal to 18.

.. image:: images/restore_queries.png
:alt: Restore dialog queries section
:align: center
Expand Down
21 changes: 21 additions & 0 deletions web/pgadmin/tools/backup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ def set_value(key, param, default_value=None, assertion=True):
data.get('only_tablespaces', None))
set_param('only_roles', '--roles-only',
data.get('only_roles', None))
# pg_dump rejects --statistics-only alongside --data-only or
# --schema-only, so suppress it the same way --schema-only is suppressed
# above. The dialog disables the switches, but a request can still arrive
# with both set.
set_param('only_statistics', '--statistics-only',
manager.version >= 180000 and
not data.get('only_data', None) and
not data.get('only_schema', None))

# Sections
set_param('pre_data', '--section=pre-data')
Expand All @@ -317,6 +325,17 @@ def set_value(key, param, default_value=None, assertion=True):
set_param('dns_table_access_method', '--no-table-access-method',
manager.version >= 150000)
set_param('dns_no_role_passwords', '--no-role-passwords')
set_param('no_policies', '--no-policies', manager.version >= 180000)
# Each of these conflicts with the matching --*-only option.
set_param('no_data', '--no-data',
manager.version >= 180000 and
not data.get('only_data', None))
set_param('no_schema', '--no-schema',
manager.version >= 180000 and
not data.get('only_schema', None))
set_param('no_statistics', '--no-statistics',
manager.version >= 180000 and
not data.get('only_statistics', None))

# Query Options
set_param('use_insert_commands', '--inserts')
Expand Down Expand Up @@ -353,6 +372,8 @@ def set_value(key, param, default_value=None, assertion=True):
set_param('verbose', '--verbose')
set_param('dqoute', '--quote-all-identifiers')
set_param('use_set_session_auth', '--use-set-session-authorization')
set_param('statistics', '--statistics', manager.version >= 180000)
set_param('sequence_data', '--sequence-data', manager.version >= 180000)
set_value('exclude_schema', '--exclude-schema')
set_value('extra_float_digits', '--extra-float-digits', None,
manager.version >= 120000)
Expand Down
97 changes: 89 additions & 8 deletions web/pgadmin/tools/backup/static/js/backup.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ export class TypeObjSchema extends BaseUISchema {
type: 'switch',
group: gettext('Type of objects'),
deps: ['pre_data', 'data', 'post_data', 'only_schema',
'only_tablespaces', 'only_roles'],
'only_tablespaces', 'only_roles', 'only_statistics'],
disabled: function(state) {
return state.pre_data ||
state.data ||
state.post_data ||
state.only_schema ||
state.only_tablespaces ||
state.only_roles;
state.only_roles ||
state.only_statistics;
},
inlineGroup: 'type_of_objects',
}, {
Expand All @@ -114,14 +115,15 @@ export class TypeObjSchema extends BaseUISchema {
type: 'switch',
group: gettext('Type of objects'),
deps: ['pre_data', 'data', 'post_data', 'only_data',
'only_tablespaces', 'only_roles'],
'only_tablespaces', 'only_roles', 'only_statistics'],
disabled: function(state) {
return state.pre_data ||
state.data ||
state.post_data ||
state.only_data ||
state.only_tablespaces ||
state.only_roles;
state.only_roles ||
state.only_statistics;
},
inlineGroup: 'type_of_objects',
}, {
Expand All @@ -130,14 +132,15 @@ export class TypeObjSchema extends BaseUISchema {
type: 'switch',
group: gettext('Type of objects'),
deps: ['pre_data', 'data', 'post_data', 'only_data', 'only_schema',
'only_roles'],
'only_roles', 'only_statistics'],
disabled: function(state) {
return state.pre_data ||
state.data ||
state.post_data ||
state.only_data ||
state.only_schema ||
state.only_roles;
state.only_roles ||
state.only_statistics;
},
visible: isVisibleForObjectBackup(obj?.top?.backupType),
inlineGroup: 'type_of_objects',
Expand All @@ -147,17 +150,36 @@ export class TypeObjSchema extends BaseUISchema {
type: 'switch',
group: gettext('Type of objects'),
deps: ['pre_data', 'data', 'post_data', 'only_data', 'only_schema',
'only_tablespaces'],
'only_tablespaces', 'only_statistics'],
inlineGroup: 'type_of_objects',
disabled: function(state) {
return state.pre_data ||
state.data ||
state.post_data ||
state.only_data ||
state.only_schema ||
state.only_tablespaces;
state.only_tablespaces ||
state.only_statistics;
},
visible: isVisibleForObjectBackup(obj?.top?.backupType)
}, {
id: 'only_statistics',
label: gettext('Only statistics'),
type: 'switch',
group: gettext('Type of objects'),
min_version: 180000,
deps: ['pre_data', 'data', 'post_data', 'only_data', 'only_schema',
'only_tablespaces', 'only_roles'],
inlineGroup: 'type_of_objects',
disabled: function(state) {
return state.pre_data ||
state.data ||
state.post_data ||
state.only_data ||
state.only_schema ||
state.only_tablespaces ||
state.only_roles;
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}, {
id: 'blobs',
label: gettext('Blobs'),
Expand Down Expand Up @@ -282,6 +304,49 @@ export class SaveOptSchema extends BaseUISchema {
group: gettext('Do not save'),
inlineGroup: 'do_not_save',
min_version: 150000
}, {
id: 'no_policies',
label: gettext('Row security policies'),
type: 'switch',
disabled: false,
group: gettext('Do not save'),
inlineGroup: 'do_not_save',
min_version: 180000
}, {
// pg_dump rejects each of these alongside the matching *Only* switch
// on the Data/Objects tab, so they follow each other's state.
id: 'no_data',
label: gettext('Data'),
type: 'switch',
group: gettext('Do not save'),
inlineGroup: 'do_not_save',
min_version: 180000,
deps: ['only_data'],
disabled: function(state) {
return state.only_data;
},
}, {
id: 'no_schema',
label: gettext('Schema'),
type: 'switch',
group: gettext('Do not save'),
inlineGroup: 'do_not_save',
min_version: 180000,
deps: ['only_schema'],
disabled: function(state) {
return state.only_schema;
},
}, {
id: 'no_statistics',
label: gettext('Statistics'),
type: 'switch',
group: gettext('Do not save'),
inlineGroup: 'do_not_save',
min_version: 180000,
deps: ['only_statistics'],
disabled: function(state) {
return state.only_statistics;
},
}];
}
}
Expand Down Expand Up @@ -384,6 +449,22 @@ export class MiscellaneousSchema extends BaseUISchema {
disabled: false,
group: gettext('Miscellaneous'),
inlineGroup: 'miscellaneous',
}, {
id: 'statistics',
label: gettext('Dump statistics'),
type: 'switch',
disabled: false,
group: gettext('Miscellaneous'),
inlineGroup: 'miscellaneous',
min_version: 180000
}, {
id: 'sequence_data',
label: gettext('Sequence data'),
type: 'switch',
disabled: false,
group: gettext('Miscellaneous'),
inlineGroup: 'miscellaneous',
min_version: 180000
}, {
id: 'exclude_schema',
label: gettext('Exclude schema'),
Expand Down
Loading
Loading