Hi, I have a problem. Console error this like following
panic: command not found: pg_dump
fmt.Println("backupp")
dump, err := pg.NewDump(&pg.Postgres{
Host: "localhost",
Port: 5432,
DB: "dev_example",
Username: "example",
Password: "example",
})
if err != nil {
panic(err)
}
dump.EnableVerbose()
dumpExec := dump.Exec(pg.ExecOptions{StreamPrint: true, StreamDestination: os.Stdout})
if dumpExec.Error != nil {
fmt.Println(dumpExec.Error.Err)
fmt.Println(dumpExec.Output)
} else {
fmt.Println("Dump success")
fmt.Println(dumpExec.Output)
}
restore, err := pg.NewRestore(&pg.Postgres{
Host: "example",
Port: 5432,
DB: "dev_example_new",
Username: "example",
Password: "example",
})
if err != nil {
panic(err)
}
restoreExec := restore.Exec(dumpExec.File, pg.ExecOptions{StreamPrint: false})
if restoreExec.Error != nil {
fmt.Println(restoreExec.Error.Err)
fmt.Println(restoreExec.Output)
} else {
fmt.Println("Restore success")
fmt.Println(restoreExec.Output)
}