You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't convert unsupported numerics to double by default (#795)
This stops converting unsupported NUMERIC sizes to doubles. This
behaviour is still supported, but it is now opt-in. This means pg_duckdb
won't silently reduce precision. It also starts requiring users to
specify precision when using NUMERIC types in a table definition,
because the default precision is different between PostgreSQL and
DuckDB.
Closes#471
---------
Co-authored-by: dentiny <[email protected]>
Copy file name to clipboardExpand all lines: test/regression/expected/array_type_support.out
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -280,6 +280,7 @@ INSERT INTO numeric_array_1d SELECT CAST(a as NUMERIC[]) FROM (VALUES
280
280
('{}')
281
281
) t(a);
282
282
SELECT * FROM numeric_array_1d;
283
+
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
283
284
a
284
285
--------------------
285
286
{1.1,2.2,3.3}
@@ -288,6 +289,17 @@ SELECT * FROM numeric_array_1d;
288
289
{}
289
290
(4 rows)
290
291
292
+
SET duckdb.convert_unsupported_numeric_to_double = true;
INSERT INTO uuid_array_1d SELECT CAST(a as UUID[]) FROM (VALUES
@@ -555,6 +567,18 @@ INSERT INTO numeric_array_2d VALUES
555
567
(NULL),
556
568
('{}'),
557
569
('{{11.1,12.2},{NULL,14.4}}');
570
+
SELECT * FROM numeric_array_2d;
571
+
WARNING: Unsupported Postgres type: DuckDB requires the precision of a NUMERIC to be set. You can choose to convert these NUMERICs to a DOUBLE by using 'SET duckdb.duckdb.convert_unsupported_numeric_to_double = true'
572
+
a
573
+
--------------------------------
574
+
{{1.1,2.2},{3.3,4.4}}
575
+
{{5.5,6.6,7.7},{8.8,9.9,10.1}}
576
+
577
+
{}
578
+
{{11.1,12.2},{NULL,14.4}}
579
+
(5 rows)
580
+
581
+
SET duckdb.convert_unsupported_numeric_to_double = true;
558
582
SELECT * FROM numeric_array_2d;
559
583
a
560
584
--------------------------------
@@ -565,6 +589,7 @@ SELECT * FROM numeric_array_2d;
0 commit comments