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
However, mac_address doesn't support the extended format so we can't do parsing of the text format. Maybe we should just implement our own wrappers instead; it wouldn't be that difficult.
Activity
abonander commentedon Mar 31, 2020
Type OID: 829
Array type OID: 1040
https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat#L244-L248
Binary format:
i8 i8 i8 i8 i8 i8(literally just 6 bytes, can pass this straight toMacAddress::new())https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/mac.c#L161
Use
mac_address::MacAddress::from_strto parse the text format.We can also support the EUI format which is just 8 literal bytes:
https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat#L260-L264
https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/mac8.c#L295
However,
mac_addressdoesn't support the extended format so we can't do parsing of the text format. Maybe we should just implement our own wrappers instead; it wouldn't be that difficult.mehcode commentedon Mar 31, 2020
https://docs.rs/eui48/0.4.6/eui48/struct.MacAddress.html
This seems to support both kinds.
abonander commentedon Mar 31, 2020
The
MacAddresstype in that crate is still just the 48-bit addresses though.EverWinter23 commentedon May 21, 2020
From @mehcode on discord:
macaddrandmacaddr8typerust-postgresdriver however only supportsmacaddrtype using theeui48crateeui48andmac_addresscrates only support the 6-bytemacaddrtypeRecommended way-- would be to implement support for
macaddrusing eithereui48ormac_address(no preference).If we want to support
macaddr8, we should add support for the type to the crate that was used.