From a72e2306194dbff7ae8cfe5d462174c263e79bf1 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 17 Nov 2026 08:03:48 -0600 Subject: [PATCH] core/store: ignore pg_attver when comparing schemas --- core/store/store.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/store/store.go b/core/store/store.go index 8e8a900cc9e..b430b3505a9 100644 --- a/core/store/store.go +++ b/core/store/store.go @@ -10,6 +10,7 @@ import ( "math/big" "net/url" "os/exec" + "regexp" "strings" "sync" "time" @@ -194,11 +195,16 @@ func dumpSchema(dbURL url.URL, restrictKey string) (string, error) { return string(schema), nil } +var pgAttVerRegExp = regexp.MustCompile(`(?m)[ \t]*\(pg_attver=\d+\);\r?$`) + func checkSchema(dbURL url.URL, prevSchema, restrictKey string) error { newSchema, err := dumpSchema(dbURL, restrictKey) if err != nil { return err } + // strip pg_attver metadata to ignore version mismatch + newSchema = pgAttVerRegExp.ReplaceAllString(newSchema, ";") + prevSchema = pgAttVerRegExp.ReplaceAllString(prevSchema, ";") df := diff.Diff(prevSchema, newSchema) if len(df) > 0 { fmt.Println(df)