You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
I ran a query_raw where the PostgreSQL column is of type CIDR or MacAddr but I got this error.
This message is in the src/ast/values.rs file, line 788.
Value in column: 192.168.100.128/25 and 08:00:2b:01:02:03
Error
CIDR Error querying the database: error deserializing column 24: cannot convert between the Rust type core::option::Option<std::net::ip::IpAddr> and the Postgres type cidr
MacAddr has the same problem Column type 'macaddr' could not be deserialized from the database.
The text was updated successfully, but these errors were encountered:
carlos-rian
changed the title
Could not convert value from CIDR type to IpAddr - PostgreSQL
Could not convert value to IpAddr - PostgreSQL
Oct 27, 2022
Now, I know absolutely nothing about Rust, but from the given error I found https://doc.rust-lang.org/std/net/struct.AddrParseError.html which led me on a hunt. Could it be from attempting to parse it with std::net::IpAddr, which does not support subnets?
PostgresType::INET | PostgresType::CIDR => match row.try_get(i)? {
Some(val) => {
let val: std::net::IpAddr = val;
Value::text(val.to_string())
}
None => Value::Text(None),
I'm sorry in advance if this is completely wrong, just trying to add some traffic onto this issue with my very limited knowledge since this fix is important to me.
carlos-rian
changed the title
Could not convert value to IpAddr - PostgreSQL
PostgreSQL - Could not convert value to IpAddr
Dec 24, 2022
Description
I ran a query_raw where the PostgreSQL column is of type CIDR or MacAddr but I got this error.
This message is in the src/ast/values.rs file, line 788.
Value in column: 192.168.100.128/25 and 08:00:2b:01:02:03
Error
CIDR
Error querying the database: error deserializing column 24: cannot convert between the Rust type core::option::Option<std::net::ip::IpAddr> and the Postgres type cidr
MacAddr has the same problem
Column type 'macaddr' could not be deserialized from the database.
The text was updated successfully, but these errors were encountered: