Search code examples
databasepostgresqlcommand-linebackuppg-dump

postgresql where does the output of pg_dump go


I am trying to backup a db of postgresql and I want to use pg_dump command.
I tried :

psql -U postgres
postgres-# pg_dump test > backup.sql

But I don't know where the output file goes.
Any help will be appreciated


Solution

  • Go to command prompt and directory postgresql\9.3\bin.

    Example

    .

    ..
        c:\Program files\postgresql\9.3\bin> pg_dump -h localhost -p 5432 -U postgres test > D:\backup.sql
    ...
    

    After above command enter User "postgres" password and check D:\ drive for backup.sql file