diff --git a/.travis.yml b/.travis.yml index 069cfcb6..a60a324e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ install: - go get -u github.com/jackc/fake - go get -u github.com/jackc/pgmock/pgmsg - go get -u github.com/lib/pq + - go get -u github.com/hashicorp/go-version script: - go test -v -race ./... diff --git a/pgtype/line_test.go b/pgtype/line_test.go index 6d3b02e1..995eaad5 100644 --- a/pgtype/line_test.go +++ b/pgtype/line_test.go @@ -3,10 +3,24 @@ package pgtype_test import ( "testing" + version "github.com/hashicorp/go-version" "github.com/jackc/pgx/pgtype" ) func TestLineTranscode(t *testing.T) { + conn := mustConnectPgx(t) + serverVersion, err := version.NewVersion(conn.RuntimeParams["server_version"]) + if err != nil { + t.Fatalf("cannot get server version: %v", err) + } + mustClose(t, conn) + + minVersion := version.Must(version.NewVersion("9.4")) + + if serverVersion.LessThan(minVersion) { + t.Skipf("Skipping line test for server version %v", serverVersion) + } + testSuccessfulTranscode(t, "line", []interface{}{ &pgtype.Line{ A: 1.23, B: 4.56, C: 7.89,