diff --git a/Cargo.lock b/Cargo.lock index a01d6991c9a..63967d34987 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5231,9 +5231,9 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.34.2" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f56a81b4fcc69016028f657a68f9b8e8a2a4b7d07684ca3298f2d3e7ff199ce" +checksum = "02d86d57e732d40382ceb9bfea80901d839bae8571aa11c06af9177aed9dfb6c" dependencies = [ "async-trait", "bytes", @@ -5246,8 +5246,10 @@ dependencies = [ "postgres-types", "rand 0.9.2", "rust_decimal", + "ryu", "serde", "serde_json", + "smol_str", "thiserror 2.0.17", "tokio", "tokio-util", @@ -7405,6 +7407,16 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" +[[package]] +name = "smol_str" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3498b0a27f93ef1402f20eefacfaa1691272ac4eca1cdc8c596cb0a245d6cbf5" +dependencies = [ + "borsh", + "serde_core", +] + [[package]] name = "socket2" version = "0.5.10" diff --git a/Cargo.toml b/Cargo.toml index c869d5a0cd0..379a0d36cc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -243,7 +243,7 @@ paste = "1.0" percent-encoding = "2.3" petgraph = { version = "0.6.5", default-features = false } pin-project-lite = "0.2.9" -pgwire = { version = "0.34.2", default-features = false, features = ["server-api", "pg-ext-types"] } +pgwire = { version = "0.37", default-features = false, features = ["server-api", "pg-ext-types"] } postgres-types = "0.2.5" pretty_assertions = { version = "1.4", features = ["unstable"] } proc-macro2 = "1.0" diff --git a/crates/pg/src/encoder.rs b/crates/pg/src/encoder.rs index e2fd8601bf6..47af3b61932 100644 --- a/crates/pg/src/encoder.rs +++ b/crates/pg/src/encoder.rs @@ -57,7 +57,7 @@ pub(crate) fn type_of(schema: &ProductType, ty: &ProductTypeElement) -> Type { _ => Type::ANYARRAY, }, AlgebraicType::Product(_) => match format { - PsqlPrintFmt::Hex => Type::BYTEA_ARRAY, + PsqlPrintFmt::Hex => Type::BYTEA, PsqlPrintFmt::Timestamp => Type::TIMESTAMP, PsqlPrintFmt::Duration => Type::INTERVAL, PsqlPrintFmt::Uuid => Type::UUID, diff --git a/crates/pg/src/pg_server.rs b/crates/pg/src/pg_server.rs index afaa8c2994e..a8ddc7bacd7 100644 --- a/crates/pg/src/pg_server.rs +++ b/crates/pg/src/pg_server.rs @@ -73,9 +73,8 @@ pub(crate) fn to_rows( let mut results = Vec::with_capacity(stmt.rows.len()); let ty = Typespace::EMPTY.with_type(&stmt.schema); + let mut encoder = DataRowEncoder::new(header.clone()); for row in stmt.rows { - let mut encoder = DataRowEncoder::new(header.clone()); - for (idx, value) in ty.with_values(&row).enumerate() { let ty = satn::PsqlType { client: PsqlClient::Postgres, @@ -86,7 +85,7 @@ pub(crate) fn to_rows( let mut fmt = PsqlFormatter { encoder: &mut encoder }; value.serialize(TypedSerializer { ty: &ty, f: &mut fmt })?; } - results.push(encoder.finish()); + results.push(Ok(encoder.take_row())); } Ok(stream::iter(results)) }