I am uncertain if its the permissions issue or something I am doing wrong and any help will be greatly appreciated. I have a dedicated Ubuntu server with Postgres DB installed on it. I want to backup the databases, but when I use pg_dump I get permission denied. Can some one help me out? Here are a few details about my set up.
On postgres: I have the following databases.
postgres,
template0,
template1,
mydb,
mydb1
I have 2 PostgreSQL users
postgres,
mydb (There are no postgresql groups defined yet)
All the other settings for postgres are default values.
On my ubuntu itself, I have 2 users.
user1,
mydb
I logged into the box as root/user1 using SSH, issued the following commands,
$ pg_dumpall > a.sql
I get, -bash: a.sql: Permission denied Same goes with pg_dump command.
I know I am missing something here. Can some one guide me to properly issue this command? TIA.