Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions datafusion-postgres/src/pg_catalog/format_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
let precision = ((typemod - 4) >> 16) & 0xffff;
let scale = (typemod - 4) & 0xffff;
if scale > 0 {
format!("numeric({},{})", precision, scale)
format!("numeric({precision},{scale})")
} else {
format!("numeric({})", precision)
format!("numeric({precision})")
}
} else {
"numeric".to_string()
Expand All @@ -132,31 +132,31 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
1083 => {
// time without time zone
if typemod >= 0 {
format!("time({}) without time zone", typemod)
format!("time({typemod}) without time zone")
} else {
"time without time zone".to_string()
}
}
1114 => {
// timestamp without time zone
if typemod >= 0 {
format!("timestamp({}) without time zone", typemod)
format!("timestamp({typemod}) without time zone")
} else {
"timestamp without time zone".to_string()
}
}
1184 => {
// timestamp with time zone
if typemod >= 0 {
format!("timestamp({}) with time zone", typemod)
format!("timestamp({typemod}) with time zone")
} else {
"timestamp with time zone".to_string()
}
}
1266 => {
// time with time zone
if typemod >= 0 {
format!("time({}) with time zone", typemod)
format!("time({typemod}) with time zone")
} else {
"time with time zone".to_string()
}
Expand All @@ -167,15 +167,15 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
1560 => {
// bit
if typemod > 0 {
format!("bit({})", typemod)
format!("bit({typemod})",)
} else {
"bit".to_string()
}
}
1562 => {
// bit varying
if typemod > 0 {
format!("bit varying({})", typemod)
format!("bit varying({typemod})")
} else {
"bit varying".to_string()
}
Expand All @@ -191,12 +191,12 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
if let Some(base_oid) = get_array_base_type(oid) {
format!("{}[]", format_postgres_type(base_oid, -1))
} else {
format!("oid({})", oid)
format!("oid({oid})")
}
}

// Unknown or invalid OID
_ => format!("oid({})", type_oid),
_ => format!("oid({type_oid})"),
}
}

Expand Down
Loading