Restore item in server or Databases menu (RM #4832)
Issue migrated from Redmine: https://redmine.postgresql.org/issues/4832 Originally created by A. Kromic at 2019-10-14 07:19:45 UTC.
A pgAdmin4 feature I have always wanted is having some "restore" command in the server or Databases context menu. That would make restoring databases much easier, especially during development and testing when various changes occur frequently.
Currently there are two options for restoring databases in pgAdmin from custom format backups, both a bit inconvenient:
Manually create database with the required name, then use Restore from its context menu; this has more steps than needed - there is no need to create the database manually
Use Restore from any existing database's menu, enabling the "CREATE DATABASE" option; faster, but potentially dangerous or inconvenient if one manages to overwrite the other database by mistake
For someone frequently dumping and restoring various databases from within pgAdmin4 while also doing development in it, the new menu item would be quite useful. Alternatively, it could be added as an option in the Create / Database menu; something like "Create Database from backup".
Comment migrated from Redmine: https://redmine.postgresql.org/issues/4832#note-1 Originally created by Akshay Joshi at 2019-10-18 10:39:13 UTC.
Redmine ticket header update:
| Name | Old Value | New Value |
|---|---|---|
| Sprint changed | Ready |
I like the idea and want to go one step further with a checkbox in the dialog:
[X] Delete existing database if it already exists
And I don't care if it is potentially dangerous, the DROP DATABASE is readily available for selection also.
If you want to make it less dangerous, let the "continue" button on that dialog read the database name to create and THEN ask "Do you really want to drop database MY_TEST_DATABSE and recreate it from backup?"