0

What is the procedure to take database backup and recovery in PostgreSQL 9.3?

I am using SQL Dump for the same, but getting an error near pg_dump.

--Example

pg_dump testdb > backupfile

--Error occurred

ERROR:  syntax error at or near "pg_dump"  
LINE 1: pg_dump testdb > backupfile  
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
Sarfaraz Makandar
  • 5,933
  • 16
  • 59
  • 84

1 Answers1

1

Use below command to take Database backup locally

pg_dump -U postgres -h 127.0.0.1 -p 5432 -Fc -f FileName.backup -w DBName

If you want to take database backup remotely Than use Remote IPAddress in place of 127.0.0.1.

max taldykin
  • 12,459
  • 5
  • 45
  • 64
Ilesh Patel
  • 2,053
  • 16
  • 27