From ed1bdfeb0920da8cc3b974d34d66e34b02156cbc Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sun, 20 Aug 2023 14:02:55 +0200 Subject: [PATCH] fix --- cmd/internal/database/postgres/postgres.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/internal/database/postgres/postgres.go b/cmd/internal/database/postgres/postgres.go index 144da22..278422b 100644 --- a/cmd/internal/database/postgres/postgres.go +++ b/cmd/internal/database/postgres/postgres.go @@ -172,7 +172,11 @@ func (db *Postgres) Upgrade() error { } // Check if pg_upgrade is present - if _, err := os.Stat(postgresUpgradeCmd); errors.Is(err, fs.ErrNotExist) { + p, err := exec.LookPath(postgresUpgradeCmd) + if err != nil { + return err + } + if _, err := os.Stat(p); errors.Is(err, fs.ErrNotExist) { db.log.Infow("pg_upgrade is not present, skipping upgrade") return nil }