How to pass in password to pg_dump?

后端 未结 16 852
深忆病人
深忆病人 2020-11-28 00:58

I\'m trying to create a cronjob to back up my database every night before something catastrophic happens. It looks like this command should meet my needs:

0          


        
16条回答
  •  醉话见心
    2020-11-28 01:19

    Note that, in windows, the pgpass.conf file must be in the following folder:

    %APPDATA%\postgresql\pgpass.conf
    

    if there's no postgresql folder inside the %APPDATA% folder, create it.

    the pgpass.conf file content is something like:

    localhost:5432:dbname:dbusername:dbpassword
    

    cheers

提交回复
热议问题