From f9e8be62a2b322505e9a8949f48ce156f6bb849a Mon Sep 17 00:00:00 2001 From: Egor Vorontsov Date: Tue, 25 Nov 2025 12:06:37 +0300 Subject: [PATCH] Allowed specifying hex strings in the Postgres escape format (\x). --- crates/lib/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index b86db057472..826bb3f6933 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -305,7 +305,7 @@ pub fn from_hex_pad, T: AsRef<[u8]>>( hex: T, ) -> Result { let hex = hex.as_ref(); - let hex = if hex.starts_with(b"0x") { + let hex = if hex.starts_with(b"0x") || hex.starts_with(b"\\x") { &hex[2..] } else if hex.starts_with(b"X'") { &hex[2..hex.len()]