Fake example if PostgreSQL server too old for JSON

This commit is contained in:
Jack Christensen 2015-09-04 14:10:18 -05:00
parent 5ea6b04624
commit 65f5b33f3f

View File

@ -12,6 +12,13 @@ func Example_JSON() {
return 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 { type person struct {
Name string `json:"name"` Name string `json:"name"`
Age int `json:"age"` Age int `json:"age"`