Difference between revisions of "Export PostgreSQL Database to Dump File"
Jump to navigation
Jump to search
(Created page with "== Purpose == This topic describes how to use the psql command to backup the PostgreSQL database to a dump file. == Import the Dump File == Just run below command and chang...") |
|||
Line 3: | Line 3: | ||
This topic describes how to use the psql command to backup the PostgreSQL database to a dump file. | This topic describes how to use the psql command to backup the PostgreSQL database to a dump file. | ||
− | == | + | == Export the Dump File == |
Just run below command and change it with the database value. | Just run below command and change it with the database value. |
Latest revision as of 19:14, 20 February 2020
Purpose
This topic describes how to use the psql command to backup the PostgreSQL database to a dump file.
Export the Dump File
Just run below command and change it with the database value.
[root@gejoreuy ~]# pg_dump -U username -h hostname -p port databasename -f filename
Note :
- username: The username to log on to the on-premises PostgreSQL database.
- hostname: The hostname of the on-premises database. You can use localhost as the hostname if you log on to the local database host.
- port: The port number of the on-premises PostgreSQL database.
- databasename: The name of the on-premises database to be backed up.
- filename: The name of the backup file to be generated.