Skip to main content

parse_oid_legacy

Function parse_oid_legacy 

Source
pub fn parse_oid_legacy(s: &str) -> Result<u32, ParseError>
Expand description

Parses an OID from s, accepting only the i32 range.

This is the historical parse_oid behavior: values are parsed as i32 and reinterpreted as u32, so text in 2147483648..=4294967295 is rejected even though it denotes a valid OID.

NOTE: This exists solely to keep the persisted PostgreSQL source cast CastStringToOid evaluation-stable across releases (see the stability contract in mz_storage_types::sources::casts). PostgreSQL replication re-casts the old tuple on delete, so widening this cast would let a value ingested pre-upgrade as an error be retracted post-upgrade as a value, leaving the error stuck. Use parse_oid everywhere else.