mirror of https://github.com/jackc/pgx.git
Fix PG version extraction in tests
parent
1fcefdc73f
commit
495d482f20
|
@ -9,6 +9,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"regexp"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ func skipPostgreSQLVersion(t testing.TB, db *sql.DB, constraintStr, msg string)
|
||||||
err = conn.Raw(func(driverConn interface{}) error {
|
err = conn.Raw(func(driverConn interface{}) error {
|
||||||
conn := driverConn.(*stdlib.Conn).Conn()
|
conn := driverConn.(*stdlib.Conn).Conn()
|
||||||
serverVersionStr := conn.PgConn().ParameterStatus("server_version")
|
serverVersionStr := conn.PgConn().ParameterStatus("server_version")
|
||||||
|
serverVersionStr = regexp.MustCompile(`^[0-9.]+`).FindString(serverVersionStr)
|
||||||
// if not PostgreSQL do nothing
|
// if not PostgreSQL do nothing
|
||||||
if serverVersionStr == "" {
|
if serverVersionStr == "" {
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue