We recently ran into this with our Parse message decoder, and handled it with some special logic for when the oid is 0, but it may make sense to bake this into Type::from_oid itself.
I am not entirely sure if that is appropriate for all the contexts Type can be used, so if this is a special case or something, maybe the only thing to do here would be update the from_oid documentation about this gotcha case.
To Reproduce:
use postgres_types::Type;
Type::from_oid(0u32).unwrap();
As the docs for Type::from_oid indicate, it will only return Some for OIDs that correspond to one of the built in types. There is no built in type with an OID of 0.
We recently ran into this with our Parse message decoder, and handled it with some special logic for when the oid is 0, but it may make sense to bake this into Type::from_oid itself.
I am not entirely sure if that is appropriate for all the contexts Type can be used, so if this is a special case or something, maybe the only thing to do here would be update the from_oid documentation about this gotcha case.
To Reproduce:
https://www.postgresql.org/docs/current/protocol-message-formats.html