“permission denied” for pg_dump output file

前端 未结 3 1699
南旧
南旧 2021-02-13 22:05

i used below command to backup my database

sudo -u user_name pg_dump dbName -f /home ..../someWhere/db.sql

but it gives me this :

pg_

3条回答
  •  我寻月下人不归
    2021-02-13 22:29

    Do it from psql command line like below

    -bash-4.1$ pg_dump -Fp dbName -f /home ..../someWhere/db.sql &
    

    -F selects the format of the output in which p is Output a plain-text SQL script file

    and & at the end will run your backup in the background.

提交回复
热议问题