How to create an SQL dump of your Postgres SQL database

I Love Xbase++ (ILX)
The portal for Xbase++ developers worldwide

Pat France

New member
Staff member
I am here to help you!
Aug 9, 2022
22
3
3
Customer Identifier
E114627
Please follow these steps to create an SQL dump (backup) of a Postgres SQL database::
  1. Open pgAdmin4 via the Start menu and connect to the server where the database is located.
  2. Right-click on the database you want to backup and select “Backup”.
  3. Choose a filename for the backup file, for example "mdidemo-dump.sql" in the "General" options tab.
  4. Select "Plain" as the format of the backup file.
  5. In the “Data/Objects” tab, select "Pre-Data", "Data" and "Post-Data"; all these options must be set to "Yes".
  6. Make sure "Blobs" is selected under "Types of objects".
1.png
2.png


Click on “Backup” to start the backup process. Note that completing the backup may take some time. The status of the process is shown as toast notifications in PgAdmin. Click on "View Processes" to verify the backup finished without errors.

3.png


The resulting file is a plain-text file with the SQL commands need to recreate your database on the same or on another machine. Such an SQL dump can be restored in PgAdmin4 as follows:
  1. Open pgAdmin4 via the Start menu and connect to the server where the database is located.
  2. Right-click on the database you want to restore the data to
  3. Select "PSQL Tool" in the "Tools" menu
  4. Type \i <path-to-dump-file> [ENTER]. Note that the path must be specified with forward slashes, eg. c:/mdidemo-dump.sql.
 

Attachments

  • 1689589815499.png
    1689589815499.png
    34.7 KB · Views: 121
  • 1689589918077.png
    1689589918077.png
    39.9 KB · Views: 108
  • 1689590038996.png
    1689590038996.png
    41.4 KB · Views: 123
  • 1689590087892.png
    1689590087892.png
    42.6 KB · Views: 122
  • 1689590163069.png
    1689590163069.png
    46.4 KB · Views: 107
Last edited: