File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,15 @@ LogicalType PostgresUtils::TypeToLogicalType(optional_ptr<PostgresTransaction> t
130
130
} else if (pgtypename == " numeric" ) {
131
131
auto width = ((type_info.type_modifier - sizeof (int32_t )) >> 16 ) & 0xffff ;
132
132
auto scale = (((type_info.type_modifier - sizeof (int32_t )) & 0x7ff ) ^ 1024 ) - 1024 ;
133
- if (type_info.type_modifier == -1 || width < 0 || scale < 0 || width > 38 ) {
133
+ if (type_info.type_modifier == -1 || width < 0 || scale < 0 ) {
134
134
// fallback to double
135
135
postgres_type.info = PostgresTypeAnnotation::NUMERIC_AS_DOUBLE;
136
136
return LogicalType::DOUBLE;
137
137
}
138
+ if (width > 38 ) {
139
+ postgres_type.info = PostgresTypeAnnotation::NUMERIC_TRUNCATE;
140
+ return LogicalType::DECIMAL (38 , scale);
141
+ }
138
142
return LogicalType::DECIMAL (width, scale);
139
143
} else if (pgtypename == " char" || pgtypename == " bpchar" ) {
140
144
postgres_type.info = PostgresTypeAnnotation::FIXED_LENGTH_CHAR;
You can’t perform that action at this time.
0 commit comments