mirror of
https://github.com/jackc/pgx.git
synced 2025-05-30 03:03:10 +00:00
Fix skip JSON tests for old servers
This commit is contained in:
parent
09e0cc4815
commit
b5901f7dba
@ -520,7 +520,7 @@ func TestConnExecInsertByteSliceIntoJSON(t *testing.T) {
|
|||||||
|
|
||||||
func serverHasJSON(t *testing.T, db *sql.DB) bool {
|
func serverHasJSON(t *testing.T, db *sql.DB) bool {
|
||||||
var hasJSON 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 {
|
if err != nil {
|
||||||
t.Fatalf("db.QueryRow unexpectedly failed: %v", err)
|
t.Fatalf("db.QueryRow unexpectedly failed: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user