Skip to main content

oid_for_column

Function oid_for_column 

Source
pub fn oid_for_column(rows: &[Value], col: &str) -> i32
Expand description

The type of col across EVERY row in the result, not just the first.

Taking the first non-null value’s type was a latent wrong answer: a column holding 3 in row one and "n/a" in row two was advertised as int8, and a client that believes the description then fails parsing "n/a" as an integer — or, on the binary path, cannot be sent the value at all. Public alias so pgcatalog types a column EXACTLY as the wire does.

The catalogue reporting bigint for a column the protocol then sends as text would be a self-contradiction a client is entitled to trust, so both go through this one function rather than two that agree today.