linux & postgresql: pg_dump example call

Trabla: linux & postgresql: pg_dump example call

Solving:
1. Login into your linux server with PostgreSQL
2. Execute command

pg_dump -h 127.0.0.1 -U [USER] --password -Fc [DBNAME]   >  [PATH]/[FILE].dump

where
-Fc    - format custom : Output a custom-format archive suitable for input into pg_restore. Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default.

Source: http://www.postgresql.org/docs/9.1/static/app-pgdump.html

Example:

pg_dump -h 127.0.0.1 -U postgres --password -Fc mydb >   > /home/user1/mydamp.dump

No comments:

Post a Comment