Skip to content

Commit

Permalink
tell pg_dump and pg_dumpall never to prompt for a password
Browse files Browse the repository at this point in the history
  • Loading branch information
orgrim committed May 7, 2021
1 parent 1c40ad7 commit 184b1d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (d *dump) dump() error {
formatOpt := fmt.Sprintf("-F%c", d.Options.Format)

command := filepath.Join(binDir, "pg_dump")
args := []string{formatOpt, "-f", file}
args := []string{formatOpt, "-f", file, "-w"}

if fileEnd == "d" && d.Options.Jobs > 1 {
args = append(args, "-j", fmt.Sprintf("%d", d.Options.Jobs))
Expand Down Expand Up @@ -546,7 +546,7 @@ func pgDumpVersion() int {

func dumpGlobals(dir string, timeFormat string, conninfo *ConnInfo) error {
command := filepath.Join(binDir, "pg_dumpall")
args := []string{"-g"}
args := []string{"-g", "-w"}

// pg_dumpall only connects to another database if it is given
// with the -l option
Expand Down

0 comments on commit 184b1d1

Please sign in to comment.