Fix skip JSON tests for old servers

This commit is contained in:
Jack Christensen 2015-11-12 15:43:48 -06:00
parent 09e0cc4815
commit b5901f7dba

View File

@ -520,7 +520,7 @@ func TestConnExecInsertByteSliceIntoJSON(t *testing.T) {
func serverHasJSON(t *testing.T, db *sql.DB) bool {
var hasJSON bool
err := db.QueryRow(`select true from pg_type where typname='json'`).Scan(&hasJSON)
err := db.QueryRow(`select exists(select 1 from pg_type where typname='json')`).Scan(&hasJSON)
if err != nil {
t.Fatalf("db.QueryRow unexpectedly failed: %v", err)
}