Skip to content

Commit

Permalink
Drop fallback to version 12
Browse files Browse the repository at this point in the history
That isn't even installed anymore...
  • Loading branch information
SuperSandro2000 committed Oct 7, 2024
1 parent 8e5f21d commit 4351b4a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions internal/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,13 @@ func Create(cfg *core.Configuration, reason string) (nowTime time.Time, returned
}

majorVersion := strings.Split(string(output), ".")[0]
pgdump := getPgdumpForVersion(majorVersion)

// if the pgdump version was not found fallback to pgdump version 12
if _, err := os.Stat(pgdump); errors.Is(err, os.ErrNotExist) {
pgdump = getPgdumpForVersion("12")
}

// run pg_dump
pipeReader, pipeWriter := io.Pipe()
errChan := make(chan error, 1) // must be buffered to ensure that `pipewriter.Close()` runs immediately
go func() {
defer pipeWriter.Close()
cmd := exec.CommandContext(ctx, pgdump,
cmd := exec.CommandContext(ctx,
getPgdumpForVersion(majorVersion),
"--host", cfg.PgHostname,
"--username", cfg.PgUsername, //NOTE: PGPASSWORD comes via inherited env variable
"--compress", "5",
Expand Down

0 comments on commit 4351b4a

Please sign in to comment.