PostgreSQL Tutorial: Logical Backup and Recovery

PostgreSQL provides pg_dumpand pg_dumpallcommands to implement logical backup.

These two commands are almost the same, guess what the names are!

Backup such as pg_dump will not cause users to block data operations.

When the database is not very large, pg_dump is not impossible!

Operation command

View a wave of commands:

image.png

Look at this command from three parts: http://postgres.cn/docs/12/app-pgdump.html

  • Connection information, specify which library to connect to and which user to use~
  • For more information on options, check out the official website.
  • Back up the database!

Make a move.

Back up data

Back up all data in Lao Zheng's database.

image.png

Data recovery

Delete the tables and other information in the current laozheng database, and then restore the data

image.png


In addition, you can also back up through the graphical interface. Just click Backup in the library location and export a text file.

Guess you like

Origin blog.csdn.net/a772304419/article/details/132929573