Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfff2b1d

Browse files
authored
fix(cli): Fix postgres TDE failing version check (#7203)
1 parent2b9d128 commitfff2b1d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎cli/server.go‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,24 +1740,24 @@ func connectToPostgres(ctx context.Context, logger slog.Logger, driver string, d
17401740
}
17411741

17421742
// Ensure the PostgreSQL version is >=13.0.0!
1743-
version,err:=sqlDB.QueryContext(ctx,"SHOWserver_version;")
1743+
version,err:=sqlDB.QueryContext(ctx,"SHOWserver_version_num;")
17441744
iferr!=nil {
17451745
returnnil,xerrors.Errorf("get postgres version: %w",err)
17461746
}
17471747
if!version.Next() {
17481748
returnnil,xerrors.Errorf("no rows returned for version select")
17491749
}
1750-
varversionStrstring
1751-
err=version.Scan(&versionStr)
1750+
varversionNumint
1751+
err=version.Scan(&versionNum)
17521752
iferr!=nil {
17531753
returnnil,xerrors.Errorf("scan version: %w",err)
17541754
}
17551755
_=version.Close()
1756-
versionStr=strings.Split(versionStr," ")[0]
1757-
ifsemver.Compare("v"+versionStr,"v13")<0 {
1758-
returnnil,xerrors.New("PostgreSQL version must be v13.0.0 or higher!")
1756+
1757+
ifversionNum<130000 {
1758+
returnnil,xerrors.Errorf("PostgreSQL version must be v13.0.0 or higher! Got: %d",versionNum)
17591759
}
1760-
logger.Debug(ctx,"connected to postgresql",slog.F("version",versionStr))
1760+
logger.Debug(ctx,"connected to postgresql",slog.F("version",versionNum))
17611761

17621762
err=migrations.Up(sqlDB)
17631763
iferr!=nil {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp