![]() If you back up all databases this way, the restore process will take more time. The pg_dumpall program exports all databases, one after another, into a single script file, which prevents you from performing the parallel restore.However, it is not recommended to use this tool because of the following reasons: Second, back up each individual database using the pg_dump program as described in the above section.īesides the pg_dump program, PostgreSQL also provides you with the pg_dumpall tool that allows you to backup all databases at once.First, from the psql, use the command \list to list all available databases in your cluster.To back up all databases, you can run the individual pg_dump command above sequentially, or parallel if you want to speed up the backup process. > c:\pgbackup\dvdrental.tar is the output backup file path. In this example, we use -F t to specify the output file as a tar file.ĭvdrental: is the name of the database that you want to back up. F : specifies the output file format that can be one of the following: After you hit enter, pg_dump will prompt for the password of postgres user. W: forces pg_dump to prompt for the password before connecting to the PostgreSQL database server. U postgres: specifies the user to connect to the PostgreSQL database server. Let’s examine the options in more detail. #Download pg commander codePg_dump -U postgres -W -F t dvdrental > c:\pgbackup\dvdrental.tar Code language: SQL (Structured Query Language) ( sql ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |