Fix PG version extraction in tests

pull/964/head
Jack Christensen 2021-03-13 07:51:28 -06:00
parent 1fcefdc73f
commit 495d482f20
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"math"
"os"
"reflect"
"regexp"
"testing"
"time"
@ -54,6 +55,7 @@ func skipPostgreSQLVersion(t testing.TB, db *sql.DB, constraintStr, msg string)
err = conn.Raw(func(driverConn interface{}) error {
conn := driverConn.(*stdlib.Conn).Conn()
serverVersionStr := conn.PgConn().ParameterStatus("server_version")
serverVersionStr = regexp.MustCompile(`^[0-9.]+`).FindString(serverVersionStr)
// if not PostgreSQL do nothing
if serverVersionStr == "" {
return nil