From ab7594a205953c774ba14b9300ed03756b273895 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 21 Aug 2023 15:56:00 +0200 Subject: [PATCH] no need for matching sidecars --- cmd/internal/database/postgres/upgrade.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/internal/database/postgres/upgrade.go b/cmd/internal/database/postgres/upgrade.go index 636cdb5..f9d78d7 100644 --- a/cmd/internal/database/postgres/upgrade.go +++ b/cmd/internal/database/postgres/upgrade.go @@ -22,7 +22,6 @@ const ( postgresUpgradeCmd = "pg_upgrade" postgresInitDBCmd = "initdb" postgresVersionFile = "PG_VERSION" - oldPostgresBindir = "/usr/local/bin/pg-old" ) var ( @@ -81,6 +80,8 @@ func (db *Postgres) Upgrade() error { return fmt.Errorf("database is newer than postgres binary") } + oldPostgresBindir := fmt.Sprintf("pg-bin-v%d", pgVersion) + // Check if old pg_config are present and match pgVersion oldPostgresConfigCmd := path.Join(oldPostgresBindir, postgresConfigCmd) if ok := db.isCommandPresent(oldPostgresConfigCmd); !ok {