@@ -749,7 +749,7 @@ impl Snapshot {
749
749
. map( |c| c. quoted_name( ) )
750
750
. collect:: <Vec <String >>( )
751
751
. join( ", " ) ,
752
- self . relation_name ( ) ,
752
+ self . relation_name_quoted ( ) ,
753
753
match self . materialized {
754
754
// If the snapshot is materialized, we already randomized it.
755
755
true => "" ,
@@ -990,7 +990,10 @@ impl Snapshot {
990
990
"int8" => row[ column. position ] . value :: < i64 > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
991
991
"float4" => row[ column. position ] . value :: < f32 > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) ) ,
992
992
"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 ( ) ) ,
994
997
"bpchar" | "text" | "varchar" => {
995
998
row[ column. position ] . value :: < String > ( ) . unwrap ( ) . map ( |v| v. to_string ( ) )
996
999
}
@@ -1084,7 +1087,7 @@ impl Snapshot {
1084
1087
check_column_size ( column, vec. len ( ) ) ;
1085
1088
1086
1089
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 ( ) )
1088
1091
}
1089
1092
}
1090
1093
_ => error ! (
@@ -1101,7 +1104,10 @@ impl Snapshot {
1101
1104
"int8" => row[ column. position ] . value :: < i64 > ( ) . unwrap ( ) . map ( |v| v as f32 ) ,
1102
1105
"float4" => row[ column. position ] . value :: < f32 > ( ) . unwrap ( ) ,
1103
1106
"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 ( ) ) ,
1105
1111
_ => error ! (
1106
1112
"Unhandled type for quantitative scalar column: {} {:?}" ,
1107
1113
column. name, column. pg_type
@@ -1156,6 +1162,16 @@ impl Snapshot {
1156
1162
false => self . relation_name . clone ( ) ,
1157
1163
}
1158
1164
}
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
+ }
1159
1175
}
1160
1176
1161
1177
#[ inline]
0 commit comments