I'm trying to execute pg_dump
for one of my PostgreSQL databases, but I am having permission problems.
C:\Windows\system32>pg_dump -U postgres -p 1863 -O social_sense > C:\\Program Files\\PostgreSQL\\8.4\\data\\social_sense.sql
I am getting the following error:
Access is denied
Can anyone enlighten?
pg_dump can be used to backup an entire database, then pg_restore can be used to examine the archive and/or select which parts of the database are to be restored. The most flexible output file formats are the “custom” format ( -Fc ) and the “directory” format ( -Fd ).
pg_dump is a regular PostgreSQL client application (albeit a particularly clever one). This means that you can perform this backup procedure from any remote host that has access to the database. But remember that pg_dump does not operate with special permissions.
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. Follow this answer to receive notifications.
restores to earlier versions not working.
I apologise for taking up your time. It was due to that there is no write permission to the directory i was writing to.
Or you can run the cmd as administrator. In my situation that solved the problem too. I know it is a bit late answer but I thought, it would help someone else maybe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With