If you got “pg_dump” is not recognized as an internal or external command” error add the path to PostgreSQL’s bin directory to the PATH environment variable (in my case it is “C:\Program Files\PostgreSQL\11\bin”). ![]() This command creates an SQL file containing commands necessary for recreating the database in the same state it was at the time of the backup. Or: pg_dump database_name -f database.sql The simplest usage of this command is: pg_dump database_name > database.sql Other backup methods, like file-level backups and continuous archiving, are bound to a particular server version and architecture. A crucial advantage of this utility is that you can restore its dumps on newer versions of PostgreSQL or on machines with different architectures. In Postgres, to extract a database into a script file or other archive file, a utility called “ pg_dump” is used. Now let’s discuss these three methods one by one but if you prefer GUI tools you can use our free application to create database backups, which is, in essence, a powerful wrapper for pg_dump that creates SQL dumps. ![]() If you need to backup PostgreSQL databases in Linux, then we recommend that you have a look at this article: How to Automate PostgreSQL Database Backups in Linux. This article describes how to backup PostgreSQL databases in Windows.
0 Comments
Leave a Reply. |