Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PG17 support #135

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/pgutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
MajorVersion14 = "14"
MajorVersion15 = "15"
MajorVersion16 = "16"
MajorVersion17 = "17"
)

const (
Expand Down Expand Up @@ -46,7 +47,7 @@ func ToPGMajorVersion(val string) (string, error) {
return "", fmt.Errorf(errCouldNotParseVersionFmt, val)
}
switch res[1] {
case MajorVersion10, MajorVersion11, MajorVersion12, MajorVersion13, MajorVersion14, MajorVersion15, MajorVersion16:
case MajorVersion10, MajorVersion11, MajorVersion12, MajorVersion13, MajorVersion14, MajorVersion15, MajorVersion16, MajorVersion17:
return res[1], nil
case "7", "8", "9":
return res[1] + res[2], nil
Expand Down
1 change: 1 addition & 0 deletions pkg/tstune/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
// ValidPGVersions is a slice representing the major versions of PostgreSQL
// for which recommendations can be generated.
var ValidPGVersions = []string{
pgutils.MajorVersion17,
pgutils.MajorVersion16,
pgutils.MajorVersion15,
pgutils.MajorVersion14,
Expand Down
4 changes: 4 additions & 0 deletions pkg/tstune/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestGetPGMajorVersion(t *testing.T) {
okPath14 := "pg_config_14"
okPath15 := "pg_config_15"
okPath16 := "pg_config_16"
okPath17 := "pg_config_17"
okPath95 := "pg_config_9.5"
okPath60 := "pg_config_6.0"
cases := []struct {
Expand Down Expand Up @@ -198,6 +199,8 @@ func TestGetPGMajorVersion(t *testing.T) {
return "PostgreSQL 15.0", nil
case okPath16:
return "PostgreSQL 16.0", nil
case okPath17:
return "PostgreSQL 17.0", nil
default:
return "", exec.ErrNotFound
}
Expand Down Expand Up @@ -235,6 +238,7 @@ func TestValidatePGMajorVersion(t *testing.T) {
pgutils.MajorVersion14: true,
pgutils.MajorVersion15: true,
pgutils.MajorVersion16: true,
pgutils.MajorVersion17: true,
"9.5": false,
"1.2.3": false,
"9.6.6": false,
Expand Down
Loading