Search code examples
postgresqlpg-dump

how i can backup the database from postgres?


I'm trying to back up the database from Postgres but:

C:/Program Files (x86)/PostgreSQL/9.3/bin\pg_dump.exe --host localhost --port 5432 --username "postgres" --no-password  --format custom --blobs --verbose --file "projet" "postgis_21_sample"
    pg_dump: [custom archiver] could not open output file "projet": Permission denied

    Process returned exit code 1.

Solution

  • You are trying to write the backup file to C:/Program Files (x86)/PostgreSQL/9.3/bin which is not writable for regular users (for a good reason).

    You need to supply a file location that is writable for your current user, e.g.

    --file "c:/Users/sara/projet"