@@ -749,7 +749,7 @@ impl Snapshot {
749749 . map( |c| c. quoted_name( ) )
750750 . collect:: <Vec <String >>( )
751751 . join( ", " ) ,
752- self . relation_name ( ) ,
752+ self . relation_name_quoted ( ) ,
753753 match self . materialized {
754754 // If the snapshot is materialized, we already randomized it.
755755 true => "" ,
@@ -990,7 +990,10 @@ impl Snapshot {
990990 "int8" => row[ column. position ] . value :: < i64 > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
991991 "float4" => row[ column. position ] . value :: < f32 > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
992992 "float8" => row[ column. position ] . value :: < f64 > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
993- "numeric" => row[ column. position ] . value :: < AnyNumeric > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
993+ "numeric" => row[ column. position ]
994+ . value :: < AnyNumeric > ( )
995+ . unwrap ( )
996+ . map ( |v| v. to_string ( ) ) ,
994997 "bpchar" | "text" | "varchar" => {
995998 row[ column. position ] . value :: < String > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) )
996999 }
@@ -1084,7 +1087,7 @@ impl Snapshot {
10841087 check_column_size ( column, vec. len ( ) ) ;
10851088
10861089 for j in vec {
1087- vector. push ( j. rescale :: < 6 , 0 > ( ) . unwrap ( ) . try_into ( ) . unwrap ( ) )
1090+ vector. push ( j. rescale :: < 6 , 0 > ( ) . unwrap ( ) . try_into ( ) . unwrap ( ) )
10881091 }
10891092 }
10901093 _ => error ! (
@@ -1101,7 +1104,10 @@ impl Snapshot {
11011104 "int8" => row[ column. position ] . value :: < i64 > ( ) . unwrap ( ) . map ( |v| v as f32 ) ,
11021105 "float4" => row[ column. position ] . value :: < f32 > ( ) . unwrap ( ) ,
11031106 "float8" => row[ column. position ] . value :: < f64 > ( ) . unwrap ( ) . map ( |v| v as f32 ) ,
1104- "numeric" => row[ column. position ] . value :: < AnyNumeric > ( ) . unwrap ( ) . map ( |v| v. rescale :: < 6 , 0 > ( ) . unwrap ( ) . try_into ( ) . unwrap ( ) ) ,
1107+ "numeric" => row[ column. position ]
1108+ . value :: < AnyNumeric > ( )
1109+ . unwrap ( )
1110+ . map ( |v| v. rescale :: < 6 , 0 > ( ) . unwrap ( ) . try_into ( ) . unwrap ( ) ) ,
11051111 _ => error ! (
11061112 "Unhandled type for quantitative scalar column: {} {:?}" ,
11071113 column. name, column. pg_type
@@ -1156,6 +1162,16 @@ impl Snapshot {
11561162 false => self . relation_name . clone ( ) ,
11571163 }
11581164 }
1165+
1166+ fn relation_name_quoted ( & self ) -> String {
1167+ match self . materialized {
1168+ true => self . snapshot_name ( ) , // Snapshot name is already safe.
1169+ false => {
1170+ let ( schema_name, table_name) = Self :: fully_qualified_table ( & self . relation_name ) ;
1171+ format ! ( "\" {}\" .\" {}\" " , schema_name, table_name)
1172+ }
1173+ }
1174+ }
11591175}
11601176
11611177#[ inline]
0 commit comments