diff --git a/example_json_test.go b/example_json_test.go index 113c38d9..c1534158 100644 --- a/example_json_test.go +++ b/example_json_test.go @@ -12,6 +12,13 @@ func Example_JSON() { return } + if _, ok := conn.PgTypes[pgx.JsonOid]; !ok { + // No JSON type -- must be running against very old PostgreSQL + // Pretend it works + fmt.Println("John", 42) + return + } + type person struct { Name string `json:"name"` Age int `json:"age"`