diff --git a/sqlx-core/src/postgres/types/mod.rs b/sqlx-core/src/postgres/types/mod.rs index 24aebb5a..f1f471da 100644 --- a/sqlx-core/src/postgres/types/mod.rs +++ b/sqlx-core/src/postgres/types/mod.rs @@ -142,8 +142,16 @@ impl Display for PgTypeInfo { impl TypeInfo for PgTypeInfo { fn compatible(&self, other: &Self) -> bool { - // TODO: 99% of postgres types are direct equality for [compatible]; when we add something that isn't (e.g, JSON/JSONB), fix this here - self.id.0 == other.id.0 + match (self.id, other.id) { + (TypeId::CIDR, TypeId::INET) + | (TypeId::INET, TypeId::CIDR) + | (TypeId::ARRAY_CIDR, TypeId::ARRAY_INET) + | (TypeId::ARRAY_INET, TypeId::ARRAY_CIDR) => true, + _ => { + // TODO: 99% of postgres types are direct equality for [compatible]; when we add something that isn't (e.g, JSON/JSONB), fix this here + self.id.0 == other.id.0 + } + } } }