Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 23, 2023
1 parent 30089be commit 122b07f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/internal/database/postgres/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,20 @@ func (db *Postgres) copyPostgresBinaries(override bool) error {
return err
}

if !override {
if _, err := os.Stat(path.Join(binDir, postgresConfigCmd)); err == nil {
db.log.Info("postgres binaries for later upgrade already in place, not copying")
return nil
}
}

version, err := db.getBinaryVersion(postgresConfigCmd)
if err != nil {
return err
}

pgBinDir := path.Join(db.datadir, fmt.Sprintf("%s%d", postgresBinBackupPrefix, version))

if !override {
if _, err := os.Stat(path.Join(pgBinDir, postgresConfigCmd)); err == nil {
db.log.Info("postgres binaries for later upgrade already in place, not copying")
return nil
}
}

err = os.RemoveAll(pgBinDir)
if err != nil {
return fmt.Errorf("unable to remove old pg bin dir: %w", err)
Expand Down

0 comments on commit 122b07f

Please sign in to comment.