Write into directory where postgres user has write access. For instance /tmp.
$ pg_dump -h localhost mydb >/tmp/tempfile
In your attempt postgres user tries to create a file in some random directory belonging to the other user.
Write into directory where postgres user has write access. For instance /tmp.
$ pg_dump -h localhost mydb >/tmp/tempfile
In your attempt postgres user tries to create a file in some random directory belonging to the other user.